mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-24 13:44:54 +00:00
Fix KV storage clear() to sync with localStorage
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -62,7 +62,11 @@ export const sparkRuntime = {
|
||||
},
|
||||
clear: () => {
|
||||
try {
|
||||
// Get keys before clearing
|
||||
const keysToRemove = Array.from(kvStorage.keys())
|
||||
kvStorage.clear()
|
||||
// Clear corresponding keys from localStorage
|
||||
keysToRemove.forEach(key => localStorage.removeItem(key))
|
||||
} catch (error) {
|
||||
console.error('Error clearing KV storage:', error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user