sync shortcut properly, #175

This commit is contained in:
FTCHD
2026-03-24 00:13:46 +02:00
parent 4bfefb5723
commit 49fccfa471
2 changed files with 23 additions and 5 deletions
+5 -3
View File
@@ -390,9 +390,11 @@ export const usePersistedStore = create<PersistedStateV2>()(
)
)
// useStore.persist.onFinishHydration(() => {
// console.log('onFinishHydration')
// })
usePersistedStore.persist.onFinishHydration((state) => {
if (state.toolbarShortcut) {
invoke('update_toolbar_shortcut', { shortcut: state.toolbarShortcut })
}
})
store.onKeyChange('store', async (_) => {
await usePersistedStore.persist.rehydrate()