mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-07 21:32:51 +00:00
Reset caches on logout
This commit is contained in:
1 parent
3b3e7c757c
commit
1642b787ec
5 files changed
+44
No files matched your search
@@ -346,6 +346,14 @@ class ProfileCache {
|
||||
this.emit("runtimeCleared", { pubkey: normalized });
|
||||
}
|
||||
|
||||
reset() {
|
||||
const previousPubkey = this.activePubkey;
|
||||
this.activePubkey = null;
|
||||
this.memoryCache.clear();
|
||||
this.emit("profileChanged", { pubkey: null, previousPubkey: previousPubkey || null });
|
||||
this.emit("reset", { previousPubkey: previousPubkey || null });
|
||||
}
|
||||
|
||||
subscribe(callback) {
|
||||
this.listeners.add(callback);
|
||||
return () => this.listeners.delete(callback);
|
||||
|
||||
Reference in new issue
Block a user