Skip to content

Commit

Permalink
Merge pull request #15945 from guoenxuan/jd-4.x
Browse files Browse the repository at this point in the history
fix: [harmony-hybrid]修复clearStorageSync报错的问题
  • Loading branch information
qican777 committed Jun 20, 2024
2 parents bbf7ced + 55a662e commit ff0279b
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 ff0279b

Please sign in to comment.