Skip to content

Commit

Permalink
add remove method for offline account cache used by MFA
Browse files Browse the repository at this point in the history
  • Loading branch information
ianopolous committed Apr 30, 2024
1 parent 2e1dc51 commit d8af7e2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions vendor/priors/gwt.js
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@ var accountCache = {
});
};
this.setLoginData = setLoginDataIntoCacheProm;
this.remove = removeLoginDataFromCacheProm;
this.getEntryData = getEntryDataFromCacheProm;
}
};
Expand All @@ -1184,6 +1185,21 @@ function setLoginDataIntoCacheProm(key, entryPoints) {
return future;
}

function removeLoginDataFromCacheProm(key) {
let future = peergos.shared.util.Futures.incomplete();
if (!this.isCachingEnabled) {
future.complete(true);
} else {
let that = this;
setIDBKV(key, [], this.cacheAccountStore).then(() => {
future.complete(true);
}).catch(err => {
future.complete(true);
});
}
return future;
}

// public native CompletableFuture<byte[]> getEntryData(String key);
function getEntryDataFromCacheProm(key) {
let that = this;
Expand Down

0 comments on commit d8af7e2

Please sign in to comment.