Преглед на файлове

Added conditional to check if billing is enabled for that project

jnfrati преди 4 години
родител
ревизия
7f3fa48b28
променени са 1 файла, в които са добавени 10 реда и са изтрити 5 реда
  1. 10 5
      dashboard/src/main/home/project-settings/ProjectSettings.tsx

+ 10 - 5
dashboard/src/main/home/project-settings/ProjectSettings.tsx

@@ -46,10 +46,12 @@ class ProjectSettings extends Component<PropsType, StateType> {
     tabOptions.push({ value: "manage-access", label: "Manage Access" });
     tabOptions.push({ value: "manage-access", label: "Manage Access" });
 
 
     if (this.props.isAuthorized("settings", "", ["get", "delete"])) {
     if (this.props.isAuthorized("settings", "", ["get", "delete"])) {
-      tabOptions.push({
-        value: "billing",
-        label: "Billing",
-      });
+      if (currentProject?.hasBilling) {
+        tabOptions.push({
+          value: "billing",
+          label: "Billing",
+        });
+      }
       tabOptions.push({
       tabOptions.push({
         value: "additional-settings",
         value: "additional-settings",
         label: "Additional Settings",
         label: "Additional Settings",
@@ -69,7 +71,10 @@ class ProjectSettings extends Component<PropsType, StateType> {
       return <InvitePage />;
       return <InvitePage />;
     }
     }
 
 
-    if (this.state.currentTab === "billing") {
+    if (
+      this.state.currentTab === "billing" &&
+      this.context.currentProject?.hasBilling
+    ) {
       return <BillingPage />;
       return <BillingPage />;
     }
     }