|
|
@@ -32,28 +32,21 @@ const storage = { |
|
|
|
localStorage.setItem(key, tempStorage[key]); |
|
|
|
}); |
|
|
|
}, |
|
|
|
init() { |
|
|
|
if (window.initialStorage) { |
|
|
|
const hash = window.initialStorage || {}; |
|
|
|
}; |
|
|
|
|
|
|
|
if (isClient && window.addIpcRendererListener) { |
|
|
|
storage.clear(); |
|
|
|
window.addIpcRendererListener( |
|
|
|
'initialStorageData', |
|
|
|
(_, hash: { keyList?: string[]; [key: string]: any }) => { |
|
|
|
const kList = hash.keyList || []; |
|
|
|
|
|
|
|
kList.forEach((key: string) => { |
|
|
|
keepSaveKeyMap.set(key, true); |
|
|
|
storage.set(key, hash[key]); |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
}; |
|
|
|
|
|
|
|
if (window.initialStorage) { |
|
|
|
storage.clear(); |
|
|
|
const hash = window.initialStorage || {}; |
|
|
|
const kList = hash.keyList || []; |
|
|
|
|
|
|
|
kList.forEach((key: string) => { |
|
|
|
keepSaveKeyMap.set(key, true); |
|
|
|
storage.set(key, hash[key]); |
|
|
|
}); |
|
|
|
}, |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
export default storage; |