feat: misc improvements

This commit is contained in:
2025-03-18 23:27:17 +00:00
parent fe1a32f31b
commit 1191cdd95c
15 changed files with 264 additions and 68 deletions

View File

@ -182,6 +182,7 @@ export const usePkgStore = defineStore('pkg', {
export const usePrfStore = defineStore('prf', () => {
const current: Ref<Profile | null> = ref(null);
const list: Ref<ProfileMeta[]> = ref([]);
let timeout: NodeJS.Timeout | null = null;
const isPkgEnabled = (pkg: Package | undefined) =>
computed(
@ -281,9 +282,13 @@ export const usePrfStore = defineStore('prf', () => {
watchEffect(async () => {
if (current.value !== null) {
await invoke('save_current_profile', {
await invoke('sync_current_profile', {
profile: { OngekiProfile: current.value },
});
if (timeout !== null) {
clearTimeout(timeout);
}
timeout = setTimeout(() => invoke('save_current_profile'), 2000);
}
});