feat: refactor friends requests

This commit is contained in:
Zamitto 2024-07-10 19:52:57 -03:00
parent b3f87d5662
commit ef0699dbea
11 changed files with 74 additions and 34 deletions

View file

@ -9,6 +9,7 @@ import type {
AppUpdaterEvent,
StartGameDownloadPayload,
GameRunning,
FriendRequestAction,
} from "@types";
contextBridge.exposeInMainWorld("electron", {
@ -137,6 +138,8 @@ contextBridge.exposeInMainWorld("electron", {
updateProfile: (displayName: string, newProfileImagePath: string | null) =>
ipcRenderer.invoke("updateProfile", displayName, newProfileImagePath),
getFriendRequests: () => ipcRenderer.invoke("getFriendRequests"),
updateFriendRequest: (userId: string, action: FriendRequestAction) =>
ipcRenderer.invoke("updateFriendRequest", userId, action),
/* User */
getUser: (userId: string) => ipcRenderer.invoke("getUser", userId),