diff --git a/src/locales/pt-PT/translation.json b/src/locales/pt-PT/translation.json index 1a522a7e..ea32f1cc 100644 --- a/src/locales/pt-PT/translation.json +++ b/src/locales/pt-PT/translation.json @@ -261,7 +261,7 @@ "new_update_available": "Versão {{version}} disponível", "restart_to_install_update": "Reinicia o Hydra para instalar a nova versão", "new_friend_request_title": "Novo pedido de amizade", - "new_friend_request_description": "Você recebeu um novo pedido de amizade" + "new_friend_request_description": "Recebeste um novo pedido de amizade" }, "system_tray": { "open": "Abrir o Hydra", diff --git a/src/main/events/autoupdater/restart-and-install-update.ts b/src/main/events/autoupdater/restart-and-install-update.ts index 7875f00c..c410ea1f 100644 --- a/src/main/events/autoupdater/restart-and-install-update.ts +++ b/src/main/events/autoupdater/restart-and-install-update.ts @@ -4,7 +4,7 @@ import updater from "electron-updater"; const { autoUpdater } = updater; -export const restartAndInstallUpdate = async () => { +export const restartAndInstallUpdate = () => { autoUpdater.removeAllListeners(); if (app.isPackaged) { autoUpdater.quitAndInstall(false); diff --git a/src/main/events/profile/sync-friend-requests.ts b/src/main/events/profile/sync-friend-requests.ts index c5a37524..2d8d0d7a 100644 --- a/src/main/events/profile/sync-friend-requests.ts +++ b/src/main/events/profile/sync-friend-requests.ts @@ -5,24 +5,24 @@ import { UserNotLoggedInError } from "@shared"; import type { FriendRequestSync } from "@types"; interface SyncState { - friendsRequest: number | null; + friendRequestCount: number | null; } const syncState: SyncState = { - friendsRequest: null, + friendRequestCount: null, }; const syncFriendRequests = async (_event: Electron.IpcMainInvokeEvent) => { return HydraApi.get(`/profile/friend-requests/sync`) .then((res) => { if ( - syncState.friendsRequest != null && - syncState.friendsRequest < res.friendRequestCount + syncState.friendRequestCount != null && + syncState.friendRequestCount < res.friendRequestCount ) { publishNewFriendRequestNotification(); } - syncState.friendsRequest = res.friendRequestCount; + syncState.friendRequestCount = res.friendRequestCount; return res; }) diff --git a/src/main/services/notifications/index.ts b/src/main/services/notifications/index.ts index 761270ce..6ddb3200 100644 --- a/src/main/services/notifications/index.ts +++ b/src/main/services/notifications/index.ts @@ -81,14 +81,14 @@ export const publishNotificationUpdateReadyToInstall = async ( }; export const publishNewFriendRequestNotification = async () => { - const userPreferences = await db.get( + const userPreferences = await db.get( levelKeys.userPreferences, { valueEncoding: "json", } ); - if (!userPreferences.friendRequestNotificationsEnabled) return; + if (!userPreferences?.friendRequestNotificationsEnabled) return; new Notification({ title: t("new_friend_request_title", { diff --git a/src/main/services/update-manager.ts b/src/main/services/update-manager.ts index 31817ac9..b933c823 100644 --- a/src/main/services/update-manager.ts +++ b/src/main/services/update-manager.ts @@ -29,14 +29,14 @@ export class UpdateManager { } if (process.platform === "linux") { - const userPreferences = await db.get( + const userPreferences = await db.get( levelKeys.userPreferences, { valueEncoding: "json", } ); - return userPreferences.enableAutoInstall === true; + return userPreferences?.enableAutoInstall === true; } return false;