feat: code adjustments

This commit is contained in:
Zamitto
2025-03-10 20:21:17 -03:00
parent 85efc23c25
commit d8a4eaaa66
5 changed files with 11 additions and 11 deletions

View File

@@ -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);

View File

@@ -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<FriendRequestSync>(`/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;
})