feat: misc improvements
This commit is contained in:
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user