From 948965dda5afcc79c697afcdafebd3361e853f8e Mon Sep 17 00:00:00 2001 From: jarome Date: Sat, 23 Nov 2024 21:39:45 -0300 Subject: [PATCH 01/23] QoL allow clearing game executable path and wine prefix --- src/locales/en/translation.json | 1 + .../modals/game-options-modal.tsx | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index fa47e507..a762d655 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -105,6 +105,7 @@ "open_folder": "Open folder", "open_download_location": "See downloaded files", "create_shortcut": "Create desktop shortcut", + "clear": "Clear", "remove_files": "Remove files", "remove_from_library_title": "Are you sure?", "remove_from_library_description": "This will remove {{game}} from your library", diff --git a/src/renderer/src/pages/game-details/modals/game-options-modal.tsx b/src/renderer/src/pages/game-details/modals/game-options-modal.tsx index 64346d52..614fa4a0 100644 --- a/src/renderer/src/pages/game-details/modals/game-options-modal.tsx +++ b/src/renderer/src/pages/game-details/modals/game-options-modal.tsx @@ -95,6 +95,11 @@ export function GameOptionsModal({ await window.electron.openGameExecutablePath(game.id); }; + const handleClearExecutablePath = async () => { + await window.electron.updateExecutablePath(game.id, ""); + updateGame(); + }; + const handleChangeWinePrefixPath = async () => { const { filePaths } = await window.electron.showOpenDialog({ properties: ["openDirectory"], @@ -106,6 +111,11 @@ export function GameOptionsModal({ } }; + const handleClearWinePrefixPath = async () => { + await window.electron.selectGameWinePrefix(game.id, ""); + updateGame(); + }; + const shouldShowWinePrefixConfiguration = window.electron.platform === "linux"; @@ -168,6 +178,9 @@ export function GameOptionsModal({ + )} @@ -196,6 +209,13 @@ export function GameOptionsModal({ } /> + {game.winePrefixPath && ( +
+ +
+ )} )} From 8b4791f1f4a060459341116daf3eefb90ec0dd73 Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Mon, 2 Dec 2024 19:12:39 +0000 Subject: [PATCH 02/23] chore: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 457f2ff8..bcc1c6f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hydralauncher", - "version": "3.0.5", + "version": "3.0.6", "description": "Hydra", "main": "./out/main/index.js", "author": "Los Broxas", From de36965017015692b1d801f93375dbe897c19171 Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Mon, 2 Dec 2024 19:37:32 +0000 Subject: [PATCH 03/23] fix: prevent loading external resources twice --- src/renderer/src/app.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/renderer/src/app.tsx b/src/renderer/src/app.tsx index bb2f096a..20810070 100644 --- a/src/renderer/src/app.tsx +++ b/src/renderer/src/app.tsx @@ -137,7 +137,10 @@ export function App() { } }) .finally(() => { + if (document.getElementById("external-resources")) return; + const $script = document.createElement("script"); + $script.id = "external-resources"; $script.src = `${import.meta.env.RENDERER_VITE_EXTERNAL_RESOURCES_URL}?t=${Date.now()}`; document.head.appendChild($script); }); From 9b9b3f73d0ef04c191de80e2c91754430479281e Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Mon, 2 Dec 2024 20:37:43 +0000 Subject: [PATCH 04/23] fix: fixing data: links on CSP --- src/renderer/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/index.html b/src/renderer/index.html index 6290dfa4..6adfcf5d 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -6,7 +6,7 @@ Hydra From 4cb3258e17d4e9100ce749de342e4e66a4fd664a Mon Sep 17 00:00:00 2001 From: Lianela <140931995+Lianela@users.noreply.github.com> Date: Mon, 2 Dec 2024 17:38:13 -0600 Subject: [PATCH 05/23] feat: updated spanish translation added missing strings --- src/locales/es/translation.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json index 2830eb0c..e521fc1d 100644 --- a/src/locales/es/translation.json +++ b/src/locales/es/translation.json @@ -255,6 +255,8 @@ "blocked_users": "Usuarios bloqueados", "user_unblocked": "El usuario ha sido desbloqueado", "enable_achievement_notifications": "Cuando un logro se desbloquea" + "launch_minimized": "Iniciar Hydra minimizado", + "disable_nsfw_alert": "Desactivar alerta NSFW" }, "notifications": { "download_complete": "Descarga completada", @@ -361,8 +363,10 @@ "user_achievements": "Logros de {{displayName}}", "your_achievements": "Tus Logros", "unlocked_at": "Desbloqueado el:", - "subscription_needed": "Se necesita una suscripción a Hydra Cloud se necesita para ver este contenido", - "new_achievements_unlocked": "Desbloqueados {{achievementCount}} nuevos logros de {{gameCount}} juegos" + "subscription_needed": "Se necesita una suscripción a Hydra Cloud necesita para ver este contenido", + "new_achievements_unlocked": "Desbloqueados {{achievementCount}} nuevos logros de {{gameCount}} juegos", + "achievement_progress": "{{unlockedCount}}/{{totalCount}} logros", + "achievements_unlocked_for_game": "Se han desbloqueado {{achievementCount}} nuevos logros de {{gameTitle}}" }, "tour": { "subscription_tour_title": "Suscripción Hydra Cloud", From 96feaf8d422463f1d88499784ff139b9b2448ebb Mon Sep 17 00:00:00 2001 From: Lianela <140931995+Lianela@users.noreply.github.com> Date: Mon, 2 Dec 2024 17:43:00 -0600 Subject: [PATCH 06/23] Update translation.json --- src/locales/es/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json index e521fc1d..2679a9fd 100644 --- a/src/locales/es/translation.json +++ b/src/locales/es/translation.json @@ -254,7 +254,7 @@ "must_be_valid_url": "La fuente debe ser una URL válida.", "blocked_users": "Usuarios bloqueados", "user_unblocked": "El usuario ha sido desbloqueado", - "enable_achievement_notifications": "Cuando un logro se desbloquea" + "enable_achievement_notifications": "Cuando un logro se desbloquea", "launch_minimized": "Iniciar Hydra minimizado", "disable_nsfw_alert": "Desactivar alerta NSFW" }, From 590a1b354de710247d3a947081c9a7cfa8f8d2d1 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Wed, 4 Dec 2024 01:57:47 -0300 Subject: [PATCH 07/23] chore: remove intercom dependency --- package.json | 1 - src/renderer/src/app.tsx | 15 +-------------- src/types/index.ts | 1 + yarn.lock | 5 ----- 4 files changed, 2 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index bcc1c6f5..68dfb39a 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "@electron-toolkit/utils": "^3.0.0", "@fontsource/noto-sans": "^5.0.22", "@hookform/resolvers": "^3.9.0", - "@intercom/messenger-js-sdk": "^0.0.14", "@primer/octicons-react": "^19.9.0", "@reduxjs/toolkit": "^2.2.3", "@vanilla-extract/css": "^1.14.2", diff --git a/src/renderer/src/app.tsx b/src/renderer/src/app.tsx index 20810070..e6f8e17d 100644 --- a/src/renderer/src/app.tsx +++ b/src/renderer/src/app.tsx @@ -120,20 +120,7 @@ export function App() { updateUserDetails(response); syncFriendRequests(); - const $existingScript = document.getElementById("user-details"); - - const content = `window.userDetails = ${JSON.stringify(response)};`; - - if ($existingScript) { - $existingScript.textContent = content; - } else { - const $script = document.createElement("script"); - $script.id = "user-details"; - $script.type = "text/javascript"; - $script.textContent = content; - - document.head.appendChild($script); - } + window["userDetails"] = response; } }) .finally(() => { diff --git a/src/types/index.ts b/src/types/index.ts index c0269cd3..434a15e7 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -241,6 +241,7 @@ export interface Subscription { status: SubscriptionStatus; plan: { id: string; name: string }; expiresAt: string | null; + paymentMethod: "pix" | "paypal"; } export interface UserDetails { diff --git a/yarn.lock b/yarn.lock index 0220a873..b6b2d3b9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1066,11 +1066,6 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== -"@intercom/messenger-js-sdk@^0.0.14": - version "0.0.14" - resolved "https://registry.yarnpkg.com/@intercom/messenger-js-sdk/-/messenger-js-sdk-0.0.14.tgz#a27999370cc0a82a2a57a779426df25a57891863" - integrity sha512-2dH4BDAh9EI90K7hUkAdZ76W79LM45Sd1OBX7t6Vzy8twpNiQ5X+7sH9G5hlJlkSGnf+vFWlFcy9TOYAyEs1hA== - "@isaacs/cliui@^8.0.2": version "8.0.2" resolved "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz" From 988c01f506f3fa4f1758f06413d6bddce57ee6c6 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Wed, 4 Dec 2024 12:11:14 -0300 Subject: [PATCH 08/23] fix: set window.userDetails after login --- src/renderer/src/app.tsx | 2 -- src/renderer/src/hooks/use-user-details.ts | 2 ++ src/renderer/src/main.tsx | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/app.tsx b/src/renderer/src/app.tsx index e6f8e17d..1ec7507e 100644 --- a/src/renderer/src/app.tsx +++ b/src/renderer/src/app.tsx @@ -119,8 +119,6 @@ export function App() { if (response) { updateUserDetails(response); syncFriendRequests(); - - window["userDetails"] = response; } }) .finally(() => { diff --git a/src/renderer/src/hooks/use-user-details.ts b/src/renderer/src/hooks/use-user-details.ts index feca478c..3328c517 100644 --- a/src/renderer/src/hooks/use-user-details.ts +++ b/src/renderer/src/hooks/use-user-details.ts @@ -56,6 +56,8 @@ export function useUserDetails() { clearUserDetails(); } + window["userDetails"] = userDetails; + return userDetails; }); }, [clearUserDetails]); diff --git a/src/renderer/src/main.tsx b/src/renderer/src/main.tsx index 2d29f831..79ca509b 100644 --- a/src/renderer/src/main.tsx +++ b/src/renderer/src/main.tsx @@ -20,6 +20,7 @@ import resources from "@locales"; import { RepacksContextProvider } from "./context"; import { SuspenseWrapper } from "./components"; +import { logger } from "./logger"; const Home = React.lazy(() => import("./pages/home/home")); const GameDetails = React.lazy( @@ -34,6 +35,8 @@ const Achievements = React.lazy( () => import("./pages/achievements/achievements") ); +console.log = logger.log; + i18n .use(LanguageDetector) .use(initReactI18next) From 124e38c782fdeb591c65453e36b52c9aef88501c Mon Sep 17 00:00:00 2001 From: Gear <88455107+GearCzech@users.noreply.github.com> Date: Thu, 5 Dec 2024 22:13:28 +0100 Subject: [PATCH 09/23] Updated czech translation --- src/locales/cs/translation.json | 122 ++++++++++++++++++++++++++++++-- 1 file changed, 116 insertions(+), 6 deletions(-) diff --git a/src/locales/cs/translation.json b/src/locales/cs/translation.json index b5b602c5..6dbb7d37 100644 --- a/src/locales/cs/translation.json +++ b/src/locales/cs/translation.json @@ -6,7 +6,11 @@ "home": { "featured": "Doporučené", "surprise_me": "Překvap mě", - "no_results": "Výsledek nenalezen" + "no_results": "Výsledek nenalezen", + "start_typing": "Začni psát pro vyhledávání...", + "hot": "Teď populární", + "weekly": "📅 Nejlepší hry týdne", + "achievements": "🏆 Hry k překonání" }, "sidebar": { "catalogue": "Katalog", @@ -20,7 +24,9 @@ "home": "Domov", "queued": "{{title}} (V řadě)", "game_has_no_executable": "Hra nemá zvolen žádný spustitelný soubor", - "sign_in": "Přihlásit se" + "sign_in": "Přihlásit se", + "friends": "Přátelé", + "need_help": "Potřebujete pomoc?" }, "header": { "search": "Vyhledat hry", @@ -113,7 +119,54 @@ "download_paused": "Stahování pozastaveno", "last_downloaded_option": "Poslední stažená možnost", "create_shortcut_success": "Zástupce vytvořen úspěšně", - "create_shortcut_error": "Chyba při pokusu vytvořit zástupce" + "create_shortcut_error": "Chyba při pokusu vytvořit zástupce", + "nsfw_content_title": "Tahle hra obsahuje nevhodný obsah", + "nsfw_content_description": "{{title}} obsahuje obsah, který by nemusel být vhodný pro všechny věkové skupiny. Jste si jisti, že chcete pokračovat?", + "allow_nsfw_content": "Pokračovat", + "refuse_nsfw_content": "Jít zpět", + "stats": "Statistiky", + "download_count": "Stažení", + "player_count": "Aktivní hráči", + "download_error": "Tahle možnost stažení není dostupná", + "download": "Stáhnout", + "executable_path_in_use": "Spustitelný soubor již používá \"{{game}}\"", + "warning": "Varování", + "hydra_needs_to_remain_open": "Pro tohle stažení, musí Hydra zůstat otevřená až do konce stahování. Pokud Hydru zavřete dříve, postup stahování bude ztracen.", + "achievements": "Achievementy", + "achievements_count":"Achievementy {{unlockedCount}}/{{achievementsCount}}", + "cloud_save": "Uložení v cloudu", + "cloud_save_description": "Uložte si svůj postup v cloud a pokračujte v hraní na jakémkoliv zářízení", + "backups": "Zálohy", + "install_backup": "Nainstalovat", + "delete_backup": "Smazat", + "create_backup": "Vytvořit zálohu", + "last_backup_date": "Poslední záloha vytvořena {{date}}", + "no_backup_preview": "Žádné zálohy nebyly nalezeny pro tuhle hru", + "restoring_backup": "Obnovuji zálohu ({{progress}} hotovo)...", + "uploading_backup": "Nahrávání zálohy...", + "no_backups": "Nemáte zatím vytvořeny žádné zálohy pro tuto hru", + "backup_uploaded": "Záloha nahrána", + "backup_deleted": "Záloha odstraněna", + "backup_restored": "Záloha obnovena", + "see_all_achievements": "Zobrazit všechny achievementy", + "sign_in_to_see_achievements": "Musíte se přihlásit pro zobrazení achievementů", + "mapping_method_automatic": "Automaticky", + "mapping_method_manual": "Manuálně", + "mapping_method_label": "Metoda mapování", + "files_automatically_mapped": "Soubory automaticky zmapovány", + "no_backups_created": "Žádné zálohy nebyly vytvořeny pro tuto hru", + "manage_files": "Spravovat soubory", + "loading_save_preview": "Hledání uložených her...", + "wine_prefix": "Wine Prefix", + "wine_prefix_description": "Wine Prefix použit pro spuštění této hry", + "no_download_option_info": "Žádné informace nejsou dostupny", + "backup_deletion_failed": "Nepovedlo se odstranit zálohu", + "max_number_of_artifacts_reached": "Dosáhli jste maximálního počtu záloh pro tuto hru", + "achievements_not_sync": "Vaše achievementy nejsou synchronizovány", + "manage_files_description": "Spravovat, které soubory budou zálohovány a obnoveny", + "select_folder": "Vybrat složku", + "backup_from": "Zálohy z {{date}}", + "custom_backup_location_set": "Vlastní umístění záloh nastaveno" }, "activation": { "title": "Aktivovat hydru", @@ -189,7 +242,21 @@ "found_download_option_zero": "Nenalezena žádná možnost stahování", "found_download_option_one": "Nalezena {{countFormatted}} možnost stahování", "found_download_option_other": "Nalezeny {{countFormatted}} možnosti stahování", - "import": "Importovat" + "import": "Importovat", + "public": "Veřejné", + "private": "Soukromé", + "friends_only": "Pouze přátelé", + "privacy": "Soukromí", + "profile_visibility": "Viditelnost profilu", + "profile_visibility_description": "Vyberte si, kdo může vidět váš profil a knihovnu", + "required_field": "Toto pole je povinné", + "source_already_exists": "Tento zdroj byl již přidán", + "must_be_valid_url": "Zdroj musí být platký odkaz URL", + "blocked_users": "Zablokovaní uživatelé", + "user_unblocked": "Uživatel byl odblokován", + "enable_achievement_notifications": "Když je odemknut achievement", + "launch_minimized": "Spustit v minimalizovaném režimu", + "disable_nsfw_alert": "Deaktivovat upozornění na nevhodný obsah" }, "notifications": { "download_complete": "Stahování dokončeno", @@ -198,7 +265,9 @@ "repack_count_one": "{{count}} repack přidán", "repack_count_other": "{{count}} repacky přidány", "new_update_available": "Version {{version}} je dostupná", - "restart_to_install_update": "Restartuj Hydru pro aktualizaci" + "restart_to_install_update": "Restartuj Hydru pro aktualizaci", + "notification_achievement_unlocked_title": "Achievement pro {{game}} byl odemknut", + "notification_achievement_unlocked_body": "{{achievement}} a dalších {{count}} byly odemknuty" }, "system_tray": { "open": "Otevřít Hydru", @@ -266,6 +335,47 @@ "no_pending_invites": "Nemáte žádné příchozí žádosti", "no_blocked_users": "Nemáte nikoho zablokovaného", "friend_code_copied": "Kód přítele zkopírován", - "undo_friendship_modal_text": "Tímto zrušíte své přátelství s {{displayName}}" + "undo_friendship_modal_text": "Tímto zrušíte své přátelství s {{displayName}}", + "privacy_hint": "Pro změnu toho, kdo tohle může vidět, jděte do <0>Nastavení", + "locked_profile": "Tento profil je soukromý", + "image_process_failure": "Nastala chyba při zpracování obrázku", + "required_field": "Toto pole je povinné", + "displayname_min_length": "Uživatelské jméno musí být minimálně 3 znaky dlouhé", + "displayname_max_length": "Uživatelské jméno musí být maximálně 50 znaků dlouhé", + "report_profile": "Nahlásit profil", + "report_reason": "Proč nahlašujete tento profil?", + "report_description": "Přídavné informace", + "report_description_placeholder": "Přídavné informace", + "report": "Nahlásit", + "report_reason_hate": "Nenávistné projevy", + "report_reason_sexual_content": "Sexuální obsah", + "report_reason_violence": "Násilí", + "report_reason_spam": "Spam", + "report_reason_other": "Ostatní", + "profile_reported": "Profil nahlášen", + "your_friend_code": "Tvůj kód přítele:", + "upload_banner": "Nahrát banner profilu", + "uploading_banner": "Nahrávání banneru", + "background_image_updated": "Obrázek pozadí byl změněn" + }, + "achievement": { + "achievement_unlocked": "Achievement odemčen", + "user_achievements": "Achievementy uživatele {{displayName}}", + "your_achievements": "Vaše achievementy", + "unlocked_at": "Odemčeno:", + "subscription_needed": "Je vyžadováno předplatné Hydra Cloud pro zobrazení tohoto obsahu", + "new_achievements_unlocked": "Odemčeno {{achievementCount}} nových achievementů z {{gameCount}} her", + "achievement_progress": "{{unlockedCount}}/{{totalCount}} achievementů", + "achievements_unlocked_for_game": "Odemčeno {{achievementCount}} nových achievementů pro {{gameTitle}}" + }, + "tour": { + "subscription_tour_title": "Předplatné Hydra Cloud", + "subscribe_now": "Připojit se", + "cloud_saving": "Ukládání v cloudu", + "cloud_achievements": "Ukládejte vaše achievementy do cloudu", + "animated_profile_picture": "Animované profilové obrázky", + "premium_support": "Prémiová podpora", + "show_and_compare_achievements": "Zobraz a porovnej achievementy s ostatními uživateli", + "animated_profile_banner": "Animovaný banner na profilu" } } From 4f6d3d70579172416b30fab49c8ddae9b8fa8b0d Mon Sep 17 00:00:00 2001 From: Gear <88455107+GearCzech@users.noreply.github.com> Date: Thu, 5 Dec 2024 22:32:31 +0100 Subject: [PATCH 10/23] fixed the last line --- src/locales/cs/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/cs/translation.json b/src/locales/cs/translation.json index 6dbb7d37..dfd5e1f2 100644 --- a/src/locales/cs/translation.json +++ b/src/locales/cs/translation.json @@ -378,4 +378,4 @@ "show_and_compare_achievements": "Zobraz a porovnej achievementy s ostatními uživateli", "animated_profile_banner": "Animovaný banner na profilu" } -} +} \ No newline at end of file From 1de973ebd086960413360a3f9a5003507dfddfc9 Mon Sep 17 00:00:00 2001 From: Gear <88455107+GearCzech@users.noreply.github.com> Date: Thu, 5 Dec 2024 22:36:12 +0100 Subject: [PATCH 11/23] Fixed by prettier now --- src/locales/cs/translation.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locales/cs/translation.json b/src/locales/cs/translation.json index dfd5e1f2..d839fa46 100644 --- a/src/locales/cs/translation.json +++ b/src/locales/cs/translation.json @@ -133,7 +133,7 @@ "warning": "Varování", "hydra_needs_to_remain_open": "Pro tohle stažení, musí Hydra zůstat otevřená až do konce stahování. Pokud Hydru zavřete dříve, postup stahování bude ztracen.", "achievements": "Achievementy", - "achievements_count":"Achievementy {{unlockedCount}}/{{achievementsCount}}", + "achievements_count": "Achievementy {{unlockedCount}}/{{achievementsCount}}", "cloud_save": "Uložení v cloudu", "cloud_save_description": "Uložte si svůj postup v cloud a pokračujte v hraní na jakémkoliv zářízení", "backups": "Zálohy", @@ -378,4 +378,4 @@ "show_and_compare_achievements": "Zobraz a porovnej achievementy s ostatními uživateli", "animated_profile_banner": "Animovaný banner na profilu" } -} \ No newline at end of file +} From 994f4568a4cba33a6871842154439938be04cc77 Mon Sep 17 00:00:00 2001 From: bankov4eto <90499490+bankov4eto@users.noreply.github.com> Date: Sat, 7 Dec 2024 10:50:06 +0200 Subject: [PATCH 12/23] Update translation.json Updated translations and corrections --- src/locales/bg/translation.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/locales/bg/translation.json b/src/locales/bg/translation.json index f9999582..bdb6e750 100644 --- a/src/locales/bg/translation.json +++ b/src/locales/bg/translation.json @@ -65,7 +65,7 @@ "calculating_eta": "Калкулиране на оставащо време…", "downloading_metadata": "Изтегляне на метадата…", "filter": "Филтрирай repacks", - "requirements": "Състемни изисквания", + "requirements": "Системни изисквания", "minimum": "Минимални", "recommended": "Препоръчителни", "paused": "Паузирано", @@ -79,8 +79,8 @@ "add_to_library": "Добави в библиотеката", "remove_from_library": "Премахни от библиотеката", "no_downloads": "Няма налични изтегляния", - "play_time": "Играно {{amount}}", - "last_time_played": "Последно играно {{period}}", + "play_time": "Игрално време {{amount}}", + "last_time_played": "Последно пускане {{period}}", "not_played_yet": "Не сте играли {{title}} все още", "next_suggestion": "Следващо предложение", "play": "Пускане", @@ -110,7 +110,7 @@ "remove_from_library_description": "Това ще премахне {{game}} от Библиотеката", "options": "Опции", "executable_section_title": "Стартиращ файл", - "executable_section_description": "Пътят на файла, който ще се изпълни, когато се щракне върху \"Играй\"", + "executable_section_description": "Пътят на файла, който ще се изпълни, когато се щракне върху \"Пускане\"", "downloads_secion_title": "Свалени", "downloads_section_description": "Вижте актуализации или други версии на тази игра", "danger_zone_section_title": "Опасна зона", @@ -162,7 +162,7 @@ "no_download_option_info": "Няма налични данни", "backup_deletion_failed": "Неуспешно изтриване на резервно копие", "max_number_of_artifacts_reached": "Достигнат максимален брой резервни копия за тази игра", - "achievements_not_sync": "Постиженията ви не са синхронизирани", + "achievements_not_sync": "Постиженията не са синхронизирани", "manage_files_description": "Управлявайте кои файлове ще бъдат архивирани и възстановени", "select_folder": "Избери папка", "backup_from": "Резервно копие от {{date}}", @@ -198,7 +198,7 @@ "downloads_completed": "Приключени", "queued": "В опашка", "no_downloads_title": "Толкова е празно", - "no_downloads_description": "Все още не сте изтеглили нищо с Hydra, но никога не е късно да започнете..", + "no_downloads_description": "Все още не сте изтеглили нищо с Hydra, но никога не е късно да започнете...", "checking_files": "Проверка на файлове…" }, "settings": { @@ -331,7 +331,7 @@ "blocked_users": "Блокирани потребители", "unblock": "Отблокирай", "no_friends_added": "Не сте добавили приятели", - "pending": "Чакащо", + "pending": "Чакащи", "no_pending_invites": "Нямате чакащи покани", "no_blocked_users": "Нямате блокирани потребители", "friend_code_copied": "Приятелския код е копиран", From 600cbfe8611a3d86fc83bccc0a10004aa51a837e Mon Sep 17 00:00:00 2001 From: bankov4eto <90499490+bankov4eto@users.noreply.github.com> Date: Sat, 7 Dec 2024 10:57:02 +0200 Subject: [PATCH 13/23] Update translation.json Updated translation and corrections --- src/locales/bg/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/bg/translation.json b/src/locales/bg/translation.json index bdb6e750..a1a5306f 100644 --- a/src/locales/bg/translation.json +++ b/src/locales/bg/translation.json @@ -29,7 +29,7 @@ "need_help": "Имате нужда от помощ??" }, "header": { - "search": "Търси игри", + "search": "Търсене", "home": "Начало", "catalogue": "Каталог", "downloads": "Изтегляния", From 173fb41e63199787142e05c190c6cc7888a8a1da Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Sat, 7 Dec 2024 16:45:31 -0300 Subject: [PATCH 14/23] feat: refactor error logs --- src/main/services/download/python-instance.ts | 6 ++++-- src/main/services/hydra-api.ts | 13 +++++++++---- src/main/services/user/get-user-data.ts | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/main/services/download/python-instance.ts b/src/main/services/download/python-instance.ts index f59b20b8..146c6553 100644 --- a/src/main/services/download/python-instance.ts +++ b/src/main/services/download/python-instance.ts @@ -174,8 +174,10 @@ export class PythonInstance { .then((response) => response.data); } - private static async handleRpcError(_error: unknown) { - await this.rpc.get("/healthcheck").catch(() => { + private static async handleRpcError(error: unknown) { + logger.error(error); + + return this.rpc.get("/healthcheck").catch(() => { logger.error( "RPC healthcheck failed. Killing process and starting again" ); diff --git a/src/main/services/hydra-api.ts b/src/main/services/hydra-api.ts index f642f43b..bac1486a 100644 --- a/src/main/services/hydra-api.ts +++ b/src/main/services/hydra-api.ts @@ -153,21 +153,26 @@ export class HydraApi { (error) => { logger.error(" ---- RESPONSE ERROR -----"); const { config } = error; + const data = JSON.parse(config.data); + logger.error( config.method, config.baseURL, config.url, - config.headers, - config.data + omit(config.headers, ["accessToken", "refreshToken"]), + Array.isArray(data) + ? data + : omit(data, ["accessToken", "refreshToken"]) ); if (error.response) { logger.error( - "Response", + "Response error:", error.response.status, error.response.data ); } else if (error.request) { - logger.error("Request", error.request); + const errorData = error.toJSON(); + logger.error("Request error:", errorData.message); } else { logger.error("Error", error.message); } diff --git a/src/main/services/user/get-user-data.ts b/src/main/services/user/get-user-data.ts index fd4e5e1d..ff012881 100644 --- a/src/main/services/user/get-user-data.ts +++ b/src/main/services/user/get-user-data.ts @@ -44,7 +44,7 @@ export const getUserData = () => { if (err instanceof UserNotLoggedInError) { return null; } - logger.error("Failed to get logged user", err); + logger.error("Failed to get logged user"); const loggedUser = await userAuthRepository.findOne({ where: { id: 1 }, relations: { subscription: true }, From a962d839a8963f70bc69f7d7eb83f6d3aa88f84d Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Sun, 8 Dec 2024 00:24:40 -0300 Subject: [PATCH 15/23] fix: chatwoot and featurebase headers --- src/main/services/window-manager.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index 4f65ef2a..9befa709 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -85,7 +85,11 @@ export class WindowManager { return callback(details); } - if (details.url.includes("intercom.io")) { + if (details.url.includes("featurebase")) { + return callback(details); + } + + if (details.url.includes("chatwoot")) { return callback(details); } From bae9e57fcd1b3974ee0c9bde9bad7b724ce448bd Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Sun, 8 Dec 2024 13:12:38 +0000 Subject: [PATCH 16/23] fix: fixing local images --- src/renderer/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/index.html b/src/renderer/index.html index 6adfcf5d..5d62f4c5 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -6,7 +6,7 @@ Hydra From 0157d546e47cfdb55811d0e98d624783156b75b3 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Sun, 8 Dec 2024 10:57:39 -0300 Subject: [PATCH 17/23] chore: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 68dfb39a..7d17cd91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hydralauncher", - "version": "3.0.6", + "version": "3.0.7", "description": "Hydra", "main": "./out/main/index.js", "author": "Los Broxas", From e978d84f5f3a76ecd0f963c91fe9148e1b52af82 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Sun, 8 Dec 2024 22:21:20 -0300 Subject: [PATCH 18/23] feat: intercepting cookies --- src/renderer/src/cookies.ts | 52 +++++++++++++++++++++++++++++++++++++ src/renderer/src/main.tsx | 3 +++ 2 files changed, 55 insertions(+) create mode 100644 src/renderer/src/cookies.ts diff --git a/src/renderer/src/cookies.ts b/src/renderer/src/cookies.ts new file mode 100644 index 00000000..b2122d83 --- /dev/null +++ b/src/renderer/src/cookies.ts @@ -0,0 +1,52 @@ +export function addCookieInterceptor() { + Object.defineProperty(document, "cookie", { + enumerable: true, + configurable: true, + get() { + const cookies = localStorage.getItem("cookies") || ""; + console.log("get cookie", cookies); + return cookies; + }, + set(cookieString) { + try { + console.log("setting cookie", cookieString); + const [cookieName, cookieValue] = cookieString.split(";")[0].split("="); + + const currentCookies = localStorage.getItem("cookies") || ""; + + console.log("pre cookies obj", currentCookies); + const cookiesObject = parseCookieStringsToObjects(currentCookies); + cookiesObject[cookieName] = cookieValue; + console.log("cookiesObject", cookiesObject); + + const newString = Object.entries(cookiesObject) + .map(([key, value]) => { + return key + "=" + value; + }) + .join("; "); + + console.log("set cookie", newString); + localStorage.setItem("cookies", newString); + } catch (err) { + console.error(err); + } + }, + }); +} + +const parseCookieStringsToObjects = ( + cookieStrings: string +): { [key: string]: string } => { + const result = {}; + + if (cookieStrings === "") return result; + + console.log(cookieStrings); + cookieStrings.split(";").forEach((cookieString) => { + console.log("forEach", cookieString); + const [name, value] = cookieString.split("="); + result[name.trim()] = value.trim(); + }); + + return result; +}; diff --git a/src/renderer/src/main.tsx b/src/renderer/src/main.tsx index 79ca509b..8f729df9 100644 --- a/src/renderer/src/main.tsx +++ b/src/renderer/src/main.tsx @@ -21,6 +21,7 @@ import resources from "@locales"; import { RepacksContextProvider } from "./context"; import { SuspenseWrapper } from "./components"; import { logger } from "./logger"; +import { addCookieInterceptor } from "./cookies"; const Home = React.lazy(() => import("./pages/home/home")); const GameDetails = React.lazy( @@ -37,6 +38,8 @@ const Achievements = React.lazy( console.log = logger.log; +addCookieInterceptor(); + i18n .use(LanguageDetector) .use(initReactI18next) From 7595f19af389f8a208e09163c486c15be5016dae Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Sun, 8 Dec 2024 22:50:39 -0300 Subject: [PATCH 19/23] feat: remove console log --- src/renderer/src/cookies.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/renderer/src/cookies.ts b/src/renderer/src/cookies.ts index b2122d83..66d046c3 100644 --- a/src/renderer/src/cookies.ts +++ b/src/renderer/src/cookies.ts @@ -3,21 +3,16 @@ export function addCookieInterceptor() { enumerable: true, configurable: true, get() { - const cookies = localStorage.getItem("cookies") || ""; - console.log("get cookie", cookies); - return cookies; + return localStorage.getItem("cookies") || ""; }, set(cookieString) { try { - console.log("setting cookie", cookieString); const [cookieName, cookieValue] = cookieString.split(";")[0].split("="); const currentCookies = localStorage.getItem("cookies") || ""; - console.log("pre cookies obj", currentCookies); const cookiesObject = parseCookieStringsToObjects(currentCookies); cookiesObject[cookieName] = cookieValue; - console.log("cookiesObject", cookiesObject); const newString = Object.entries(cookiesObject) .map(([key, value]) => { @@ -25,7 +20,6 @@ export function addCookieInterceptor() { }) .join("; "); - console.log("set cookie", newString); localStorage.setItem("cookies", newString); } catch (err) { console.error(err); @@ -41,9 +35,7 @@ const parseCookieStringsToObjects = ( if (cookieStrings === "") return result; - console.log(cookieStrings); cookieStrings.split(";").forEach((cookieString) => { - console.log("forEach", cookieString); const [name, value] = cookieString.split("="); result[name.trim()] = value.trim(); }); From 0dea7004794a2323fd3f7f5b05573798a4d265d0 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:18:37 -0300 Subject: [PATCH 20/23] feat: adjustments on clear button --- src/locales/en/translation.json | 3 +- src/locales/es/translation.json | 6 +- src/locales/pt-BR/translation.json | 4 +- .../events/library/select-game-wine-prefix.ts | 4 +- .../events/library/update-executable-path.ts | 8 ++- src/preload/index.ts | 4 +- src/renderer/src/declaration.d.ts | 10 ++- .../modals/game-options-modal.tsx | 63 ++++++++++--------- 8 files changed, 62 insertions(+), 40 deletions(-) diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index a762d655..940e3185 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -167,7 +167,8 @@ "manage_files_description": "Manage which files will be backed up and restored", "select_folder": "Select folder", "backup_from": "Backup from {{date}}", - "custom_backup_location_set": "Custom backup location set" + "custom_backup_location_set": "Custom backup location set", + "no_directory_selected": "No directory selected" }, "activation": { "title": "Activate Hydra", diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json index 2679a9fd..ab34be1f 100644 --- a/src/locales/es/translation.json +++ b/src/locales/es/translation.json @@ -100,7 +100,7 @@ "open_screenshot": "Abrir captura {{number}}", "download_settings": "Ajustes de descarga", "downloader": "Método de descarga", - "select_executable": "Seleccionar ejecutable", + "select_executable": "Seleccionar", "no_executable_selected": "No se seleccionó un ejecutable", "open_folder": "Abrir carpeta", "open_download_location": "Ver archivos descargados", @@ -166,7 +166,9 @@ "manage_files_description": "Gestiona los archivos que serán respaldados y restaurados", "select_folder": "Seleccionar carpeta", "backup_from": "Copia de seguridad de {{date}}", - "custom_backup_location_set": "Se configuró la carpeta de copia de seguridad" + "custom_backup_location_set": "Se configuró la carpeta de copia de seguridad", + "clear": "Limpiar", + "no_directory_selected": "No se seleccionó un directório" }, "activation": { "title": "Activar Hydra", diff --git a/src/locales/pt-BR/translation.json b/src/locales/pt-BR/translation.json index 43c18a48..e724cdc3 100644 --- a/src/locales/pt-BR/translation.json +++ b/src/locales/pt-BR/translation.json @@ -162,7 +162,9 @@ "backup_from": "Backup de {{date}}", "custom_backup_location_set": "Localização customizada selecionada", "select_folder": "Selecione a pasta", - "manage_files_description": "Gerencie quais arquivos serão feitos backup" + "manage_files_description": "Gerencie quais arquivos serão feitos backup", + "clear": "Limpar", + "no_directory_selected": "Nenhum diretório selecionado" }, "activation": { "title": "Ativação", diff --git a/src/main/events/library/select-game-wine-prefix.ts b/src/main/events/library/select-game-wine-prefix.ts index a75a3cb0..d9f01c08 100644 --- a/src/main/events/library/select-game-wine-prefix.ts +++ b/src/main/events/library/select-game-wine-prefix.ts @@ -5,9 +5,9 @@ import { registerEvent } from "../register-event"; const selectGameWinePrefix = async ( _event: Electron.IpcMainInvokeEvent, id: number, - winePrefixPath: string + winePrefixPath: string | null ) => { - return gameRepository.update({ id }, { winePrefixPath }); + return gameRepository.update({ id }, { winePrefixPath: winePrefixPath }); }; registerEvent("selectGameWinePrefix", selectGameWinePrefix); diff --git a/src/main/events/library/update-executable-path.ts b/src/main/events/library/update-executable-path.ts index 9be36ab1..aee80771 100644 --- a/src/main/events/library/update-executable-path.ts +++ b/src/main/events/library/update-executable-path.ts @@ -6,14 +6,18 @@ import { parseExecutablePath } from "../helpers/parse-executable-path"; const updateExecutablePath = async ( _event: Electron.IpcMainInvokeEvent, id: number, - executablePath: string + executablePath: string | null ) => { + const parsedPath = executablePath + ? parseExecutablePath(executablePath) + : null; + return gameRepository.update( { id, }, { - executablePath: parseExecutablePath(executablePath), + executablePath: parsedPath, } ); }; diff --git a/src/preload/index.ts b/src/preload/index.ts index 3f2f677a..f9d19644 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -87,9 +87,9 @@ contextBridge.exposeInMainWorld("electron", { ipcRenderer.invoke("addGameToLibrary", objectId, title, shop), createGameShortcut: (id: number) => ipcRenderer.invoke("createGameShortcut", id), - updateExecutablePath: (id: number, executablePath: string) => + updateExecutablePath: (id: number, executablePath: string | null) => ipcRenderer.invoke("updateExecutablePath", id, executablePath), - selectGameWinePrefix: (id: number, winePrefixPath: string) => + selectGameWinePrefix: (id: number, winePrefixPath: string | null) => ipcRenderer.invoke("selectGameWinePrefix", id, winePrefixPath), verifyExecutablePathInUse: (executablePath: string) => ipcRenderer.invoke("verifyExecutablePathInUse", executablePath), diff --git a/src/renderer/src/declaration.d.ts b/src/renderer/src/declaration.d.ts index 2ffcfab7..93c423e0 100644 --- a/src/renderer/src/declaration.d.ts +++ b/src/renderer/src/declaration.d.ts @@ -80,8 +80,14 @@ declare global { shop: GameShop ) => Promise; createGameShortcut: (id: number) => Promise; - updateExecutablePath: (id: number, executablePath: string) => Promise; - selectGameWinePrefix: (id: number, winePrefixPath: string) => Promise; + updateExecutablePath: ( + id: number, + executablePath: string | null + ) => Promise; + selectGameWinePrefix: ( + id: number, + winePrefixPath: string | null + ) => Promise; verifyExecutablePathInUse: (executablePath: string) => Promise; getLibrary: () => Promise; openGameInstaller: (gameId: number) => Promise; diff --git a/src/renderer/src/pages/game-details/modals/game-options-modal.tsx b/src/renderer/src/pages/game-details/modals/game-options-modal.tsx index 614fa4a0..e5c83ec4 100644 --- a/src/renderer/src/pages/game-details/modals/game-options-modal.tsx +++ b/src/renderer/src/pages/game-details/modals/game-options-modal.tsx @@ -96,7 +96,7 @@ export function GameOptionsModal({ }; const handleClearExecutablePath = async () => { - await window.electron.updateExecutablePath(game.id, ""); + await window.electron.updateExecutablePath(game.id, null); updateGame(); }; @@ -112,7 +112,7 @@ export function GameOptionsModal({ }; const handleClearWinePrefixPath = async () => { - await window.electron.selectGameWinePrefix(game.id, ""); + await window.electron.selectGameWinePrefix(game.id, null); updateGame(); }; @@ -155,14 +155,21 @@ export function GameOptionsModal({ disabled placeholder={t("no_executable_selected")} rightContent={ - + <> + + {game.executablePath && ( + + )} + } /> @@ -178,9 +185,6 @@ export function GameOptionsModal({ - )} @@ -199,23 +203,26 @@ export function GameOptionsModal({ disabled placeholder={t("no_directory_selected")} rightContent={ - + <> + + {game.winePrefixPath && ( + + )} + } /> - {game.winePrefixPath && ( -
- -
- )} )} From 45f2727415b58d2a1d34f362d0f45a290bb16d7c Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:58:46 -0300 Subject: [PATCH 21/23] chore: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7d17cd91..3eb7bae4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hydralauncher", - "version": "3.0.7", + "version": "3.0.8", "description": "Hydra", "main": "./out/main/index.js", "author": "Los Broxas", From d8b59cae05e69fc7981cbc07875aed03be46b77c Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:29:31 -0300 Subject: [PATCH 22/23] feat: differ staging cookie --- src/renderer/src/cookies.ts | 10 ++++++---- src/renderer/src/main.tsx | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/cookies.ts b/src/renderer/src/cookies.ts index 66d046c3..b769ed7f 100644 --- a/src/renderer/src/cookies.ts +++ b/src/renderer/src/cookies.ts @@ -1,15 +1,17 @@ -export function addCookieInterceptor() { +export function addCookieInterceptor(isStaging: boolean) { + const cookieKey = isStaging ? "cookies-staging" : "cookies"; + Object.defineProperty(document, "cookie", { enumerable: true, configurable: true, get() { - return localStorage.getItem("cookies") || ""; + return localStorage.getItem(cookieKey) || ""; }, set(cookieString) { try { const [cookieName, cookieValue] = cookieString.split(";")[0].split("="); - const currentCookies = localStorage.getItem("cookies") || ""; + const currentCookies = localStorage.getItem(cookieKey) || ""; const cookiesObject = parseCookieStringsToObjects(currentCookies); cookiesObject[cookieName] = cookieValue; @@ -20,7 +22,7 @@ export function addCookieInterceptor() { }) .join("; "); - localStorage.setItem("cookies", newString); + localStorage.setItem(cookieKey, newString); } catch (err) { console.error(err); } diff --git a/src/renderer/src/main.tsx b/src/renderer/src/main.tsx index 8f729df9..f2e326c3 100644 --- a/src/renderer/src/main.tsx +++ b/src/renderer/src/main.tsx @@ -38,7 +38,8 @@ const Achievements = React.lazy( console.log = logger.log; -addCookieInterceptor(); +const isStaging = await window.electron.isStaging(); +addCookieInterceptor(isStaging); i18n .use(LanguageDetector) From fd8c57bff0669c56de8fa0cbfc50dfbeeeef5a80 Mon Sep 17 00:00:00 2001 From: jarome Date: Wed, 11 Dec 2024 13:24:54 -0300 Subject: [PATCH 23/23] fix: implemented workaround for broken or missing tray icon menu on linux --- src/main/services/window-manager.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index 9befa709..426d7afe 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -195,7 +195,7 @@ export class WindowManager { this.mainWindow?.focus(); } - public static createSystemTray(language: string) { + public static async createSystemTray(language: string) { let tray: Tray; if (process.platform === "darwin") { @@ -263,6 +263,7 @@ export class WindowManager { }, ]); + tray.setContextMenu(contextMenu); return contextMenu; }; @@ -274,6 +275,8 @@ export class WindowManager { tray.setToolTip("Hydra"); if (process.platform !== "darwin") { + await updateSystemTray(); + tray.addListener("click", () => { if (this.mainWindow) { if (