mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🎨 增加批量移除本地 kv 存储接口
This commit is contained in:
parent
f36a8721e9
commit
a5d0a6afae
3 changed files with 35 additions and 3 deletions
|
|
@ -286,7 +286,7 @@ func getCriteria() (ret []*Criterion, err error) {
|
|||
|
||||
var localStorageLock = sync.Mutex{}
|
||||
|
||||
func RemoveLocalStorageVal(key string) (err error) {
|
||||
func RemoveLocalStorageVals(keys []string) (err error) {
|
||||
localStorageLock.Lock()
|
||||
defer localStorageLock.Unlock()
|
||||
|
||||
|
|
@ -295,7 +295,9 @@ func RemoveLocalStorageVal(key string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
delete(localStorage, key)
|
||||
for _, key := range keys {
|
||||
delete(localStorage, key)
|
||||
}
|
||||
return setLocalStorage(localStorage)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue