From d048d562a3ee900e8e0a1a0d0d17c11b92dc5309 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Sun, 16 Jun 2024 19:51:09 -0300 Subject: [PATCH] rename username parameter to userId --- src/main/events/user/get-user.ts | 4 ++-- src/preload/index.ts | 2 +- src/renderer/src/components/sidebar/sidebar-profile.tsx | 2 +- src/renderer/src/declaration.d.ts | 2 +- src/renderer/src/main.tsx | 2 +- src/renderer/src/pages/user/user.tsx | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/events/user/get-user.ts b/src/main/events/user/get-user.ts index 2a2eec9d..65d3e9e0 100644 --- a/src/main/events/user/get-user.ts +++ b/src/main/events/user/get-user.ts @@ -7,10 +7,10 @@ import { getSteamAppAsset } from "@main/helpers"; const getUser = async ( _event: Electron.IpcMainInvokeEvent, - username: string + userId: string ): Promise => { try { - const response = await HydraApi.get(`/user/${username}`); + const response = await HydraApi.get(`/user/${userId}`); const profile = response.data; const recentGames = await Promise.all( diff --git a/src/preload/index.ts b/src/preload/index.ts index 609a5831..53fc6f47 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -130,7 +130,7 @@ contextBridge.exposeInMainWorld("electron", { getMe: () => ipcRenderer.invoke("getMe"), /* User */ - getUser: (username: string) => ipcRenderer.invoke("getUser", username), + getUser: (userId: string) => ipcRenderer.invoke("getUser", userId), /* Auth */ signout: () => ipcRenderer.invoke("signout"), diff --git a/src/renderer/src/components/sidebar/sidebar-profile.tsx b/src/renderer/src/components/sidebar/sidebar-profile.tsx index 4771e032..0d710c77 100644 --- a/src/renderer/src/components/sidebar/sidebar-profile.tsx +++ b/src/renderer/src/components/sidebar/sidebar-profile.tsx @@ -13,7 +13,7 @@ export function SidebarProfile() { }; const handleClickLogin = () => { - window.electron.openExternal("https://losbroxas.org"); + window.electron.openExternal("https://auth.losbroxas.org"); }; if (isLoading) return null; diff --git a/src/renderer/src/declaration.d.ts b/src/renderer/src/declaration.d.ts index 4cbacfe2..b97b4379 100644 --- a/src/renderer/src/declaration.d.ts +++ b/src/renderer/src/declaration.d.ts @@ -117,7 +117,7 @@ declare global { onSignOut: (cb: () => void) => () => Electron.IpcRenderer; /* User */ - getUser: (username: string) => Promise; + getUser: (userId: string) => Promise; /* Profile */ getMe: () => Promise; diff --git a/src/renderer/src/main.tsx b/src/renderer/src/main.tsx index 9f136e97..e8fa203b 100644 --- a/src/renderer/src/main.tsx +++ b/src/renderer/src/main.tsx @@ -55,7 +55,7 @@ ReactDOM.createRoot(document.getElementById("root")!).render( - + diff --git a/src/renderer/src/pages/user/user.tsx b/src/renderer/src/pages/user/user.tsx index 01bc2831..e50ea1e2 100644 --- a/src/renderer/src/pages/user/user.tsx +++ b/src/renderer/src/pages/user/user.tsx @@ -10,19 +10,19 @@ import { vars } from "@renderer/theme.css"; import * as styles from "./user.css"; export const User = () => { - const { username } = useParams(); + const { userId } = useParams(); const [userProfile, setUserProfile] = useState(); const dispatch = useAppDispatch(); useEffect(() => { - window.electron.getUser(username!).then((userProfile) => { + window.electron.getUser(userId!).then((userProfile) => { if (userProfile) { dispatch(setHeaderTitle(userProfile.displayName)); setUserProfile(userProfile); } }); - }, [dispatch, username]); + }, [dispatch, userId]); return (