fix: updatePrefs calls using object params.

This commit is contained in:
Darshan
2025-08-09 10:54:10 +05:30
parent 6875cdd304
commit d05248bf4e
10 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ function updateNotificationPrefs(parsedPrefs: Record<string, NotificationPrefIte
notificationPrefs: parsedPrefs
};
sdk.forConsole.account.updatePrefs(newPrefs);
sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
}
/**
+1 -1
View File
@@ -26,5 +26,5 @@ export async function setHasOnboardingDismissed(projectId: string, account?: Acc
onboardingDismissed: onboardingDismissed
};
await sdk.forConsole.account.updatePrefs(newPrefs);
await sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
}
+1 -1
View File
@@ -21,7 +21,7 @@ export function updateSidebarState(page: Page, state: 'closed' | 'open' | 'icons
sidebarState: state
};
sdk.forConsole.account.updatePrefs(newPrefs);
sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ export const joinWaitlistSites = (user: Account) => {
joinWaitlistSites: true
};
sdk.forConsole.account.updatePrefs(newPrefs);
sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
if (sessionStorage) {
sessionStorage.setItem('joinWaitlistSites', 'true');
+1 -1
View File
@@ -54,7 +54,7 @@ async function updateConsolePreferences(store: ConsolePreferencesStore): Promise
...store
};
await sdk.forConsole.account.updatePrefs(currentPreferences);
await sdk.forConsole.account.updatePrefs({ prefs: currentPreferences });
}
function createPreferences() {
@@ -30,7 +30,7 @@
newOnboardingCompleted: true
};
sdk.forConsole.account.updatePrefs(newPrefs);
sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
}
async function createProject() {
@@ -39,7 +39,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => {
}
if (prefs.organization !== params.organization) {
const newPrefs = { ...prefs, organization: params.organization };
sdk.forConsole.account.updatePrefs(newPrefs);
sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
}
const [organization, members, countryList, locale] = await Promise.all([
@@ -64,7 +64,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => {
};
} catch (e) {
const newPrefs = { ...prefs, organization: null };
sdk.forConsole.account.updatePrefs(newPrefs);
sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
error(e.code, e.message);
}
};
@@ -34,7 +34,7 @@
}
const prefs = await sdk.forConsole.account.getPrefs();
const newPrefs = { ...prefs, organization: null };
await sdk.forConsole.account.updatePrefs(newPrefs);
await sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
if ($organizationList?.total > 1) {
await goto(`${base}/account/organizations`);
} else {
@@ -10,7 +10,7 @@
const today = new Date().toISOString();
const prefs = await sdk.forConsole.account.getPrefs();
const newPrefs = { ...prefs, DPA: today };
sdk.forConsole.account.updatePrefs(newPrefs);
sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
}
</script>
@@ -48,10 +48,10 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => {
const scopes = rolesResult?.scopes ?? defaultScopes;
if (prefs?.organization !== project.teamId) {
sdk.forConsole.account.updatePrefs({
sdk.forConsole.account.updatePrefs({ prefs: {
...prefs,
organization: project.teamId
});
} });
}
preferences.loadTeamPrefs(project.teamId);