mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-21 10:03:56 +00:00
feat: code adjustments
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user