mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 13:56:16 +00:00
Merge branch 'main' into feat/adding-review-translations
This commit is contained in:
@@ -66,10 +66,7 @@ export function UserProfileContextProvider({
|
||||
const isMe = userDetails?.id === userProfile?.id;
|
||||
|
||||
const getHeroBackgroundFromImageUrl = async (imageUrl: string) => {
|
||||
const output = await average(imageUrl, {
|
||||
amount: 1,
|
||||
format: "hex",
|
||||
});
|
||||
const output = await average(imageUrl, { amount: 1, format: "hex" });
|
||||
|
||||
return `linear-gradient(135deg, ${darkenColor(output as string, 0.5)}, ${darkenColor(output as string, 0.6, 0.5)})`;
|
||||
};
|
||||
@@ -135,9 +132,8 @@ export function UserProfileContextProvider({
|
||||
getUserLibraryGames();
|
||||
|
||||
return window.electron.hydraApi
|
||||
.get<UserProfile | null>(`/users/${userId}`)
|
||||
.get<UserProfile>(`/users/${userId}`)
|
||||
.then((userProfile) => {
|
||||
if (userProfile) {
|
||||
setUserProfile(userProfile);
|
||||
|
||||
if (userProfile.profileImageUrl) {
|
||||
@@ -145,18 +141,16 @@ export function UserProfileContextProvider({
|
||||
(color) => setHeroBackground(color)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
})
|
||||
.catch(() => {
|
||||
showErrorToast(t("user_not_found"));
|
||||
navigate(-1);
|
||||
}
|
||||
});
|
||||
}, [navigate, getUserStats, getUserLibraryGames, showErrorToast, userId, t]);
|
||||
|
||||
const getBadges = useCallback(async () => {
|
||||
const language = i18n.language.split("-")[0];
|
||||
const params = new URLSearchParams({
|
||||
locale: language,
|
||||
});
|
||||
const params = new URLSearchParams({ locale: language });
|
||||
|
||||
const badges = await window.electron.hydraApi.get<Badge[]>(
|
||||
`/badges?${params.toString()}`,
|
||||
|
||||
@@ -1047,9 +1047,9 @@
|
||||
optionalDependencies:
|
||||
global-agent "^3.0.0"
|
||||
|
||||
"@electron/node-gyp@git+https://github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2":
|
||||
"@electron/node-gyp@https://github.com/electron/node-gyp#06b29aafb7708acef8b3669835c8a7857ebc92d2":
|
||||
version "10.2.0-electron.1"
|
||||
resolved "git+https://github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2"
|
||||
resolved "https://github.com/electron/node-gyp#06b29aafb7708acef8b3669835c8a7857ebc92d2"
|
||||
dependencies:
|
||||
env-paths "^2.2.0"
|
||||
exponential-backoff "^3.1.1"
|
||||
|
||||
Reference in New Issue
Block a user