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