Skip to content

Commit

Permalink
fix(App): 修复 uni.getStorageInfo 获取部分 key 失去的问题 fixed #2577
Browse files Browse the repository at this point in the history
  • Loading branch information
zhetengbiji committed Apr 6, 2021
1 parent e14c3ef commit 0bfd153
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platforms/app-plus/service/api/storage/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export function getStorageInfo () {
let currentSize = 0
for (let index = 0; index < length; index++) {
const key = plus.storage.key(index)
if (key !== STORAGE_KEYS && key.indexOf(STORAGE_DATA_TYPE) + STORAGE_DATA_TYPE.length !== key.length) {
if (key !== STORAGE_KEYS && (key.indexOf(STORAGE_DATA_TYPE) < 0 || key.indexOf(STORAGE_DATA_TYPE) + STORAGE_DATA_TYPE.length !== key.length)) {
const value = plus.storage.getItem(key)
currentSize += key.length + value.length
keys.push(key)
Expand Down

0 comments on commit 0bfd153

Please sign in to comment.