Add onLogout method to desktop bridge

This commit is contained in:
Tom Moor
2022-12-01 18:14:51 -05:00
parent d09a3de800
commit b305154715
2 changed files with 9 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import Team from "~/models/Team";
import User from "~/models/User";
import env from "~/env";
import { client } from "~/utils/ApiClient";
import Desktop from "~/utils/Desktop";
import Storage from "~/utils/Storage";
const AUTH_STORE = "AUTH_STORE";
@ -325,5 +326,8 @@ export default class AuthStore {
this.team = null;
this.policies = [];
this.token = null;
// Tell the host application we logged out, if any allows window cleanup.
Desktop.bridge?.onLogout?.();
};
}

View File

@ -31,6 +31,11 @@ declare global {
*/
onTitlebarDoubleClick: () => Promise<void>;
/**
* Passes log out events from the app to the main process
*/
onLogout: () => Promise<void>;
/**
* Adds a custom host to config
*/