mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: team prefs
This commit is contained in:
@@ -110,9 +110,7 @@ function createPreferences() {
|
||||
|
||||
return n;
|
||||
}),
|
||||
loadTeamPrefs: async () => {
|
||||
const id = get(organization)?.$id;
|
||||
if (!id) return {};
|
||||
loadTeamPrefs: async (id: string) => {
|
||||
const teamPrefs = await sdk.forConsole.teams.getPrefs(id);
|
||||
update((n) => {
|
||||
n[id] = teamPrefs;
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Dependencies } from '$lib/constants';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { error } from '@sveltejs/kit';
|
||||
import type { LayoutLoad } from './$types';
|
||||
import { preferences } from '$lib/stores/preferences';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
depends(Dependencies.PROJECT);
|
||||
@@ -10,6 +11,7 @@ export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
const project = await sdk.forConsole.projects.get(params.project);
|
||||
localStorage.setItem('project', project.$id);
|
||||
localStorage.setItem('organization', project.teamId);
|
||||
preferences.loadTeamPrefs(project.teamId);
|
||||
|
||||
return {
|
||||
project,
|
||||
|
||||
-2
@@ -6,10 +6,8 @@ import Header from './header.svelte';
|
||||
import { error } from '@sveltejs/kit';
|
||||
import SubNavigation from './subNavigation.svelte';
|
||||
import { Query } from '@appwrite.io/console';
|
||||
import { preferences } from '$lib/stores/preferences';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
await preferences.loadTeamPrefs();
|
||||
depends(Dependencies.COLLECTION);
|
||||
try {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user