clear electron store on logout
This commit is contained in:
parent
17dd41152e
commit
6cef335264
|
@ -19,6 +19,9 @@ import {
|
|||
} from 'types/user';
|
||||
import { getFamilyData, isPartOfFamily } from 'utils/billing';
|
||||
import { ServerErrorCodes } from 'utils/error';
|
||||
import isElectron from 'is-electron';
|
||||
import { runningInBrowser } from '../utils/common';
|
||||
import { ElectronAPIsInterface } from '../types/electron';
|
||||
|
||||
const ENDPOINT = getEndpoint();
|
||||
|
||||
|
@ -121,6 +124,14 @@ export const logoutUser = async () => {
|
|||
// ignore
|
||||
}
|
||||
await clearFiles();
|
||||
|
||||
if (isElectron()) {
|
||||
const ElectronAPIs = (runningInBrowser() &&
|
||||
window['ElectronAPIs']) as ElectronAPIsInterface;
|
||||
if (ElectronAPIs && ElectronAPIs.clearElectronStore) {
|
||||
ElectronAPIs.clearElectronStore();
|
||||
}
|
||||
}
|
||||
router.push(PAGES.ROOT);
|
||||
} catch (e) {
|
||||
logError(e, 'logoutUser failed');
|
||||
|
|
|
@ -62,4 +62,5 @@ export interface ElectronAPIsInterface {
|
|||
) => Promise<void>
|
||||
) => void;
|
||||
doesFolderExists: (dirPath: string) => Promise<boolean>;
|
||||
clearElectronStore: () => void;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue