fix: hydrated

This commit is contained in:
Dogtiti
2024-09-03 20:29:01 +08:00
parent 886ffc0af8
commit ed9aae531e
3 changed files with 14 additions and 5 deletions

View File

@@ -5,11 +5,7 @@ class IndexedDBStorage implements StateStorage {
public async getItem(name: string): Promise<string | null> {
try {
const value = (await get(name)) || localStorage.getItem(name);
const _value = JSON.parse(value);
if (_value?.state) {
_value.state._hasHydrated = true;
}
return JSON.stringify(_value);
return value;
} catch (error) {
return localStorage.getItem(name);
}