Skip to content

Commit

Permalink
fix: 修复clearStorageSync报错的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
guoenxuan committed Jun 20, 2024
1 parent c12054b commit 9b4aecc
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ class ProxyHandler {
// this.nativeApi['removeStorage']({key: key})
}
}
if (propKey === 'clearStorageSync') {
return (...args: any[]) => {
// 先更新缓存,再同步原生
this.cacheMap.clear()

args[0].fail = () => {}
args[0].success = () => {}
Reflect.apply(target.clearStorage, target, args)
}
}

if (propKey === 'getStorage') {
return (...args: any[]) => {
Expand Down

0 comments on commit 9b4aecc

Please sign in to comment.