Skip to content

Commit

Permalink
fix(subscriptions): hide user-subs button in header menu when subs di…
Browse files Browse the repository at this point in the history
…sabled
  • Loading branch information
NicolasRichel committed Jan 3, 2022
1 parent 5a2e877 commit a0399b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@
{{ $t("AppHeaderMenu.entryOldPlatform") }}
</BIMDataButton>
<div class="separator"></div>
<BIMDataButton ghost squared @click="goToUserSubscriptions">
<BIMDataButton
v-if="isSubscriptionEnabled"
ghost
squared
@click="goToUserSubscriptions"
>
<span>{{ $t("AppHeaderMenu.subscriptionPlatform") }}</span>
</BIMDataButton>
<BIMDataButton ghost squared @click="openLanguageSelector">
Expand Down Expand Up @@ -66,6 +71,7 @@

<script>
import { useRouter } from "vue-router";
import { IS_SUBSCRIPTION_ENABLED } from "@/config/subscription.js";
import routeNames from "@/router/route-names.js";
import { useToggle } from "@/composables/toggle.js";
import { useAuth } from "@/state/auth.js";
Expand Down Expand Up @@ -119,6 +125,7 @@ export default {
return {
// References
isSubscriptionEnabled: IS_SUBSCRIPTION_ENABLED,
showLanguageSelector,
user,
// Methods
Expand Down
5 changes: 1 addition & 4 deletions src/services/OrganizationService.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { privateApiClient } from "./api-client.js";
import { ERRORS, ErrorService, RuntimeError } from "./ErrorService.js";
import { ERRORS, RuntimeError } from "./ErrorService.js";

class OrganizationService {
async fetchUserOrganizations() {
try {
return await privateApiClient.get("/organization");
} catch (error) {
ErrorService.handleError(
new RuntimeError(ERRORS.ORGANIZATIONS_FETCH_ERROR, error)
);
return [];
}
}
Expand Down

0 comments on commit a0399b4

Please sign in to comment.