Skip to content

Commit

Permalink
fix(editor): Fix cloud plan data loading on instance (#7841)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiloradFilipovic committed Nov 29, 2023
1 parent 95854db commit b0039a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/editor-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,11 @@ export default defineComponent({
return;
}
await Promise.all([
await Promise.allSettled([
this.initializeSourceControl(),
this.initializeTemplates(),
this.initializeNodeTranslationHeaders(),
this.initializeCloudData(),
]);
this.onAfterAuthenticateInitialized = true;
Expand All @@ -162,7 +163,6 @@ export default defineComponent({
await this.settingsStore.initialize();
await this.initializeHooks();
await this.initializeCloudData();
void this.checkForNewVersions();
void this.onAfterAuthenticate();
Expand Down
6 changes: 4 additions & 2 deletions packages/editor-ui/src/stores/cloudPlan.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const useCloudPlanStore = defineStore(STORES.CLOUD_PLAN, () => {

const hasCloudPlan = computed(() => {
const cloudUserId = settingsStore.settings.n8nMetadata?.userId;
return usersStore.currentUser?.isOwner && settingsStore.isCloudDeployment && cloudUserId;
return usersStore.isInstanceOwner && settingsStore.isCloudDeployment && cloudUserId;
});

const getUserCloudAccount = async () => {
Expand Down Expand Up @@ -142,7 +142,9 @@ export const useCloudPlanStore = defineStore(STORES.CLOUD_PLAN, () => {
if (!userIsTrialing.value) return;
await getInstanceCurrentUsage();
startPollingInstanceUsageData();
} catch {}
} catch (e) {
console.error('Error fetching cloud plan data', e);
}
};

const fetchUserCloudAccount = async () => {
Expand Down

0 comments on commit b0039a3

Please sign in to comment.