mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-02 19:42:51 +08:00
fix: preserve remembered browser identity on exit
This commit is contained in:
1 parent
96ba467d52
commit
cb3dbe4ca4
3 files changed
+24
-5
No files matched your search
@@ -118,6 +118,18 @@ export async function saveStoredIdentity(privateMaterial: string, label = "此
|
||||
}
|
||||
}
|
||||
|
||||
export async function removeStoredIdentity(): Promise<void> {
|
||||
try {
|
||||
await request("identities", "readwrite", (store, resolve, reject) => {
|
||||
const remove = store.delete(CURRENT_IDENTITY_KEY);
|
||||
remove.onsuccess = () => resolve(undefined);
|
||||
remove.onerror = () => reject(remove.error);
|
||||
});
|
||||
} catch {
|
||||
// Identity removal is best effort when browser storage is unavailable.
|
||||
}
|
||||
}
|
||||
|
||||
export async function loadLocalPreferences(): Promise<LocalPreferences> {
|
||||
const defaults: LocalPreferences = { schemaVersion: 1, volumesByUid: {} };
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user