Merge branch 'feat/migration-to-leveldb' into feature/custom-themes

This commit is contained in:
Hachi-R
2025-01-23 15:45:23 -03:00
parent 44aed56461
commit 6bf049d136
131 changed files with 1918 additions and 2597 deletions

View File

@@ -1,7 +1,8 @@
import { Notification } from "electron";
import { registerEvent } from "../register-event";
import { userPreferencesRepository } from "@main/repository";
import { t } from "i18next";
import { db, levelKeys } from "@main/level";
import type { UserPreferences } from "@types";
const publishNewRepacksNotification = async (
_event: Electron.IpcMainInvokeEvent,
@@ -9,9 +10,12 @@ const publishNewRepacksNotification = async (
) => {
if (newRepacksCount < 1) return;
const userPreferences = await userPreferencesRepository.findOne({
where: { id: 1 },
});
const userPreferences = await db.get<string, UserPreferences>(
levelKeys.userPreferences,
{
valueEncoding: "json",
}
);
if (userPreferences?.repackUpdatesNotificationsEnabled) {
new Notification({