mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-23 10:51:02 +00:00
30 lines
786 B
TypeScript
30 lines
786 B
TypeScript
import { db, levelKeys } from "@main/level";
|
|
import { registerEvent } from "../register-event";
|
|
import { WindowManager } from "@main/services";
|
|
import { UserPreferences } from "@types";
|
|
|
|
const updateAchievementCustomNotificationWindow = async (
|
|
_event: Electron.IpcMainInvokeEvent
|
|
) => {
|
|
const userPreferences = await db.get<string, UserPreferences>(
|
|
levelKeys.userPreferences,
|
|
{
|
|
valueEncoding: "json",
|
|
}
|
|
);
|
|
|
|
WindowManager.closeNotificationWindow();
|
|
|
|
if (
|
|
userPreferences.achievementNotificationsEnabled !== false &&
|
|
userPreferences.achievementCustomNotificationsEnabled !== false
|
|
) {
|
|
WindowManager.createNotificationWindow();
|
|
}
|
|
};
|
|
|
|
registerEvent(
|
|
"updateAchievementCustomNotificationWindow",
|
|
updateAchievementCustomNotificationWindow
|
|
);
|