clear remote ids on sign in

This commit is contained in:
Zamitto 2024-06-19 00:07:15 -03:00
parent 2c9129c7b6
commit 2e5a324669
2 changed files with 7 additions and 0 deletions

View File

@ -3,6 +3,7 @@ import axios, { AxiosError, AxiosInstance } from "axios";
import { WindowManager } from "./window-manager"; import { WindowManager } from "./window-manager";
import url from "url"; import url from "url";
import { uploadGamesBatch } from "./library-sync"; import { uploadGamesBatch } from "./library-sync";
import { clearGamesRemoteIds } from "./library-sync/clear-games-remote-id";
export class HydraApi { export class HydraApi {
private static instance: AxiosInstance; private static instance: AxiosInstance;
@ -50,6 +51,7 @@ export class HydraApi {
if (WindowManager.mainWindow) { if (WindowManager.mainWindow) {
WindowManager.mainWindow.webContents.send("on-signin"); WindowManager.mainWindow.webContents.send("on-signin");
await clearGamesRemoteIds();
uploadGamesBatch(); uploadGamesBatch();
} }
} }

View File

@ -0,0 +1,5 @@
import { gameRepository } from "@main/repository";
export const clearGamesRemoteIds = () => {
return gameRepository.update({}, { remoteId: null });
};