Skip to content

A self-hosted media server and file management system

fix: usePersisted does not persist correctly

aminnausinf68897a009a0
diff --git a/resources/js/stores/AppStore.ts b/resources/js/stores/AppStore.ts
index 40ba5357..6070febe 100644
--- a/resources/js/stores/AppStore.ts
+++ b/resources/js/stores/AppStore.ts
@@ -19,9 +19,7 @@ function usePersisted<T extends boolean>(key: string, defaultValue: T) {
function init() {
const cached = localStorage.getItem(key);
- if (cached !== undefined) return;
-
- state.value = defaultValue;
+ state.value = cached === null ? defaultValue : cached === 'true';
localStorage.setItem(key, booleanToString(state.value));
}