fix(editor): Don't show email banner if cloud info is missing (no-changelog) (#16948)

This commit is contained in:
Milorad FIlipović
2025-07-03 10:25:09 +02:00
committed by GitHub
parent 716cb9aaca
commit 1e96d5436e
2 changed files with 17 additions and 1 deletions

View File

@@ -280,6 +280,22 @@ describe('Init', () => {
expect(cloudStoreSpy).toHaveBeenCalled();
expect(uiStore.pushBannerToStack).toHaveBeenCalledWith('EMAIL_CONFIRMATION');
});
it('should not push EMAIL_CONFIRMATION banner if user cloud account does not exist', async () => {
settingsStore.settings.deployment.type = 'cloud';
usersStore.usersById = { '123': { id: '123', email: '' } as IUser };
usersStore.currentUserId = '123';
cloudPlanStore.userIsTrialing = false;
cloudPlanStore.currentUserCloudInfo = null;
const cloudStoreSpy = vi.spyOn(cloudPlanStore, 'initialize').mockResolvedValueOnce();
await initializeAuthenticatedFeatures(false);
expect(cloudStoreSpy).toHaveBeenCalled();
expect(uiStore.pushBannerToStack).not.toHaveBeenCalledWith('EMAIL_CONFIRMATION');
});
});
});
});

View File

@@ -157,7 +157,7 @@ export async function initializeAuthenticatedFeatures(
} else {
uiStore.pushBannerToStack('TRIAL');
}
} else if (!cloudPlanStore.currentUserCloudInfo?.confirmed) {
} else if (cloudPlanStore.currentUserCloudInfo?.confirmed === false) {
uiStore.pushBannerToStack('EMAIL_CONFIRMATION');
}
} catch (e) {