mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge pull request #271 from appwrite/feat-remember-overview-last-tab
feat: remember overview last tab
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
import { base } from '$app/paths';
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import { get } from 'svelte/store';
|
||||
import type { PageLoad } from './$types';
|
||||
import { selectedTab } from './store';
|
||||
|
||||
export const load: PageLoad = async ({ params }) => {
|
||||
throw redirect(302, `${base}/console/project-${params.project}/overview/platforms`);
|
||||
if (get(selectedTab) === 'keys') {
|
||||
throw redirect(302, `${base}/console/project-${params.project}/overview/keys`);
|
||||
} else {
|
||||
throw redirect(302, `${base}/console/project-${params.project}/overview/platforms`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { selectedTab } from '../store';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
selectedTab.set('keys');
|
||||
|
||||
export const load: PageLoad = async ({ params, depends }) => {
|
||||
depends(Dependencies.KEYS);
|
||||
return {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { selectedTab } from '../store';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
selectedTab.set('platforms');
|
||||
|
||||
export const load: PageLoad = async ({ params, depends }) => {
|
||||
depends(Dependencies.PLATFORMS);
|
||||
return {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { cachedStore } from '$lib/helpers/cache';
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { writable, type Writable } from 'svelte/store';
|
||||
|
||||
export const usage = cachedStore<
|
||||
Models.UsageProject,
|
||||
@@ -15,3 +16,5 @@ export const usage = cachedStore<
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
export const selectedTab: Writable<'platforms' | 'keys'> = writable('platforms');
|
||||
|
||||
Reference in New Issue
Block a user