diff --git a/src/main/services/hydra-api.ts b/src/main/services/hydra-api.ts index 5e8e74b8..b398cbd8 100644 --- a/src/main/services/hydra-api.ts +++ b/src/main/services/hydra-api.ts @@ -3,6 +3,7 @@ import axios, { AxiosError, AxiosInstance } from "axios"; import { WindowManager } from "./window-manager"; import url from "url"; import { uploadGamesBatch } from "./library-sync"; +import { clearGamesRemoteIds } from "./library-sync/clear-games-remote-id"; export class HydraApi { private static instance: AxiosInstance; @@ -50,6 +51,7 @@ export class HydraApi { if (WindowManager.mainWindow) { WindowManager.mainWindow.webContents.send("on-signin"); + await clearGamesRemoteIds(); uploadGamesBatch(); } } diff --git a/src/main/services/library-sync/clear-games-remote-id.ts b/src/main/services/library-sync/clear-games-remote-id.ts new file mode 100644 index 00000000..f26d65f1 --- /dev/null +++ b/src/main/services/library-sync/clear-games-remote-id.ts @@ -0,0 +1,5 @@ +import { gameRepository } from "@main/repository"; + +export const clearGamesRemoteIds = () => { + return gameRepository.update({}, { remoteId: null }); +};