mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: prevent api calls when user is not logged in
This commit is contained in:
parent
9870213fff
commit
dd23358a95
11 changed files with 39 additions and 43 deletions
|
@ -60,12 +60,7 @@ export const watchProcesses = async () => {
|
|||
if (game.remoteId) {
|
||||
updateGamePlaytime(game, 0, new Date());
|
||||
} else {
|
||||
createGame({ ...game, lastTimePlayed: new Date() }).then(
|
||||
(response) => {
|
||||
const { id: remoteId } = response.data;
|
||||
gameRepository.update({ objectID: game.objectID }, { remoteId });
|
||||
}
|
||||
);
|
||||
createGame({ ...game, lastTimePlayed: new Date() });
|
||||
}
|
||||
|
||||
gamesPlaytime.set(game.id, {
|
||||
|
@ -84,10 +79,7 @@ export const watchProcesses = async () => {
|
|||
game.lastTimePlayed!
|
||||
);
|
||||
} else {
|
||||
createGame(game).then((response) => {
|
||||
const { id: remoteId } = response.data;
|
||||
gameRepository.update({ objectID: game.objectID }, { remoteId });
|
||||
});
|
||||
createGame(game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue