mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: clear local games on signout
feat: signout modal text
This commit is contained in:
parent
7b453852b6
commit
9eff4010d7
6 changed files with 26 additions and 12 deletions
13
src/main/events/auth/sign-out.ts
Normal file
13
src/main/events/auth/sign-out.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { gameRepository, userAuthRepository } from "@main/repository";
|
||||
import { registerEvent } from "../register-event";
|
||||
import { HydraApi } from "@main/services/hydra-api";
|
||||
|
||||
const signOut = async (_event: Electron.IpcMainInvokeEvent): Promise<void> => {
|
||||
await Promise.all([
|
||||
userAuthRepository.delete({ id: 1 }),
|
||||
gameRepository.delete({}),
|
||||
HydraApi.post("/auth/logout").catch(),
|
||||
]);
|
||||
};
|
||||
|
||||
registerEvent("signOut", signOut);
|
Loading…
Add table
Add a link
Reference in a new issue