mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-26 04:11:02 +00:00
feat: create UserSubscription
This commit is contained in:
@@ -113,8 +113,8 @@ const compareFile = async (game: Game, file: AchievementFile) => {
|
||||
logger.log(
|
||||
"Detected change in file",
|
||||
file.filePath,
|
||||
currentStat.mtimeMs,
|
||||
fileStats.get(file.filePath)
|
||||
previousStat,
|
||||
currentStat.mtimeMs
|
||||
);
|
||||
await processAchievementFileDiff(game, file);
|
||||
} catch (err) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
import { HydraApi } from "../hydra-api";
|
||||
import { AchievementData } from "@types";
|
||||
import { UserNotLoggedInError } from "@shared";
|
||||
import { logger } from "../logger";
|
||||
|
||||
export const getGameAchievementData = async (
|
||||
objectId: string,
|
||||
@@ -35,7 +36,7 @@ export const getGameAchievementData = async (
|
||||
if (err instanceof UserNotLoggedInError) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
logger.error("Failed to get game achievements", err);
|
||||
return gameAchievementRepository
|
||||
.findOne({
|
||||
where: { objectId, shop },
|
||||
|
||||
@@ -22,11 +22,15 @@ const saveAchievementsOnLocal = async (
|
||||
},
|
||||
["objectId", "shop"]
|
||||
)
|
||||
.then(async () => {
|
||||
WindowManager.mainWindow?.webContents.send(
|
||||
`on-update-achievements-${objectId}-${shop}`,
|
||||
await getGameAchievements(objectId, shop as GameShop)
|
||||
);
|
||||
.then(() => {
|
||||
return getGameAchievements(objectId, shop as GameShop)
|
||||
.then((achievements) => {
|
||||
WindowManager.mainWindow?.webContents.send(
|
||||
`on-update-achievements-${objectId}-${shop}`,
|
||||
achievements
|
||||
);
|
||||
})
|
||||
.catch(() => {});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user