Skip to content

Commit df66862

Browse files
authored
updated install state to reflect fs behaviour of android (#1118)
1 parent c203c35 commit df66862

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/lib/installState.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ export default class InstallState {
2929
state.store = JSON.parse(
3030
await fsOperation(state.storeUrl).readFile("utf-8"),
3131
);
32+
33+
const patchedStore = {};
34+
for (const [key, value] of Object.entries(state.store)) {
35+
patchedStore[key.toLowerCase()] = value;
36+
}
37+
38+
state.store = patchedStore;
3239
} else {
3340
state.store = {};
3441
await fsOperation(INSTALL_STATE_STORAGE).createFile(state.id);
@@ -48,6 +55,7 @@ export default class InstallState {
4855
* @returns
4956
*/
5057
async isUpdated(url, content) {
58+
url = url.toLowerCase();
5159
const current = this.store[url];
5260
const update =
5361
typeof content === "string"
@@ -62,8 +70,13 @@ export default class InstallState {
6270
}
6371
}
6472

73+
/**
74+
*
75+
* @param {string} url
76+
* @returns
77+
*/
6578
exists(url) {
66-
if (typeof this.store[url] !== "undefined") {
79+
if (typeof this.store[url.toLowerCase()] !== "undefined") {
6780
return true;
6881
} else {
6982
return false;
@@ -78,6 +91,7 @@ export default class InstallState {
7891
}
7992

8093
async delete(url) {
94+
url = url.toLowerCase();
8195
if (await fsOperation(url).exists()) {
8296
await fsOperation(url).delete();
8397
}

0 commit comments

Comments
 (0)