mirror of
https://github.com/gosticks/plane.git
synced 2025-10-16 12:45:33 +00:00
[WEB-4915]fix: redirection after onboarding completion #7824
This commit is contained in:
parent
696635dbb0
commit
365d2d902c
@ -168,17 +168,15 @@ export class ProfileStore implements IUserProfileStore {
|
|||||||
// update user onboarding status
|
// update user onboarding status
|
||||||
await this.userService.updateUserOnBoard();
|
await this.userService.updateUserOnBoard();
|
||||||
|
|
||||||
// update the user profile store
|
// Wait for user settings to be refreshed with cache-busting before updating onboarding status
|
||||||
runInAction(() => {
|
await Promise.all([
|
||||||
this.mutateUserProfile({ ...dataToUpdate, is_onboarded: true });
|
|
||||||
});
|
|
||||||
|
|
||||||
// Also fetch from backend to ensure consistency and refresh user settings with cache-busting
|
|
||||||
Promise.all([
|
|
||||||
this.fetchUserProfile(),
|
this.fetchUserProfile(),
|
||||||
this.store.user.userSettings.fetchCurrentUserSettings(true), // Cache-busting enabled
|
this.store.user.userSettings.fetchCurrentUserSettings(true), // Cache-busting enabled
|
||||||
]).catch((error) => {
|
]);
|
||||||
console.error("Background sync failed:", error);
|
|
||||||
|
// Only after settings are refreshed, update the user profile store to mark as onboarded
|
||||||
|
runInAction(() => {
|
||||||
|
this.mutateUserProfile({ ...dataToUpdate, is_onboarded: true });
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
runInAction(() => {
|
runInAction(() => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user