feat: moving notifications

This commit is contained in:
Chubby Granny Chaser 2024-06-05 14:20:32 +01:00
parent ef036d6f57
commit 9eb90bac62
No known key found for this signature in database

View file

@ -22,3 +22,23 @@ export const publishDownloadCompleteNotification = async (game: Game) => {
}).show();
}
};
export const publishNewRepacksNotifications = async (count: number) => {
const userPreferences = await userPreferencesRepository.findOne({
where: { id: 1 },
});
if (count > 0 && userPreferences?.repackUpdatesNotificationsEnabled) {
new Notification({
title: t("repack_list_updated", {
ns: "notifications",
lng: userPreferences?.language || "en",
}),
body: t("repack_count", {
ns: "notifications",
lng: userPreferences?.language || "en",
count: count,
}),
}).show();
}
};