feat: remember current tab

This commit is contained in:
2025-04-27 05:56:04 +00:00
parent bf4c06ee2d
commit 6cc7a537b6
10 changed files with 86 additions and 41 deletions

View File

@ -322,7 +322,7 @@ export const usePrfStore = defineStore('prf', () => {
const generalStore = useGeneralStore();
const configDir = computed(async () => {
return await path.join(
return path.join(
await generalStore.configDir,
`profile-${current.value?.meta.game}-${current.value?.meta.name}`
);
@ -374,6 +374,7 @@ export const useClientStore = defineStore('client', () => {
const theme: Ref<'light' | 'dark' | 'system'> = ref('system');
const onboarded: Ref<Game[]> = ref([]);
const locale: Ref<Locale> = ref('en');
const currentTab: Ref<string> = ref('');
const _scaleValue = (value: ScaleType) =>
value === 's' ? 1 : value === 'm' ? 1.25 : value === 'l' ? 1.5 : 2;
@ -440,6 +441,10 @@ export const useClientStore = defineStore('client', () => {
if (input.locale) {
locale.value = input.locale;
}
if (input.currentTab) {
currentTab.value = input.currentTab;
}
await setLocale(locale.value);
await setTheme(theme.value);
} catch (e) {
@ -478,6 +483,7 @@ export const useClientStore = defineStore('client', () => {
theme: theme.value,
onboarded: onboarded.value,
locale: locale.value,
currentTab: currentTab.value,
})
);
};
@ -553,6 +559,7 @@ export const useClientStore = defineStore('client', () => {
locale,
timeout,
scaleModel,
currentTab,
_scaleValue,
scaleValue,
load,