Skip to content

Commit 8759227

Browse files
committed
fix storage not accessible after calling clearStore
1 parent 772fed9 commit 8759227

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/api.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ getCurrentMMKVInstanceIDs() {
288288
}
289289

290290
clearStore() {
291-
return handleAction(global.clearMMKV, this.instanceID);
291+
let cleared = handleAction(global.clearMMKV, this.instanceID);
292+
global.setBoolMMKV(this.instanceID,true,this.instanceID)
293+
return cleared;
292294
}
293295
}

src/initializer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function setup(id, mode) {
118118
if (global.containsKeyMMKV(id, id)) {
119119
return true;
120120
} else {
121-
encryptionHandler(id, mode);
121+
return encryptionHandler(id, mode);
122122
}
123123
}
124124
}
@@ -133,7 +133,7 @@ function setupWithEncryption(id, mode, key, alias) {
133133
if (global.containsKeyMMKV(id, id)) {
134134
return true;
135135
} else {
136-
encryptionHandler(id, mode);
136+
return encryptionHandler(id, mode);
137137
}
138138
}
139139
}

0 commit comments

Comments
 (0)