From 2b2f29da612cb53de742c98fea1507c02abc26a0 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Sun, 22 Sep 2024 16:20:45 -0300 Subject: [PATCH 1/4] chore: add envs to pipeline --- .github/workflows/build.yml | 2 ++ .github/workflows/release.yml | 2 ++ package.json | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85a7fe1f3..5cc4aa4d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,6 +41,7 @@ jobs: yarn build:linux env: MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_API_URL }} + MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_AUTH_URL }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} MAIN_VITE_SENTRY_DSN: ${{ vars.MAIN_VITE_SENTRY_DSN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -50,6 +51,7 @@ jobs: run: yarn build:win env: MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_API_URL }} + MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_AUTH_URL }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} MAIN_VITE_SENTRY_DSN: ${{ vars.MAIN_VITE_SENTRY_DSN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e21acfcbe..96b6a08db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,6 +43,7 @@ jobs: yarn build:linux env: MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_API_URL }} + MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_AUTH_URL }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} MAIN_VITE_SENTRY_DSN: ${{ vars.MAIN_VITE_SENTRY_DSN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -52,6 +53,7 @@ jobs: run: yarn build:win env: MAIN_VITE_API_URL: ${{ vars.MAIN_VITE_API_URL }} + MAIN_VITE_AUTH_URL: ${{ vars.MAIN_VITE_AUTH_URL }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} MAIN_VITE_SENTRY_DSN: ${{ vars.MAIN_VITE_SENTRY_DSN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 734a98368..a9fd77868 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hydralauncher", - "version": "2.1.6", + "version": "2.1.7", "description": "Hydra", "main": "./out/main/index.js", "author": "Los Broxas", From d5a510175f06f32fa7b5fc2c1343662b68c36f50 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Sun, 22 Sep 2024 16:21:01 -0300 Subject: [PATCH 2/4] feat: use env to open auth window --- .env.example | 3 ++- src/main/services/window-manager.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 47d1a1e3a..34502a204 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ -MAIN_VITE_STEAMGRIDDB_API_KEY=YOUR_API_KEY MAIN_VITE_API_URL=API_URL +MAIN_VITE_AUTH_URL=AUTH_URL +MAIN_VITE_STEAMGRIDDB_API_KEY=YOUR_API_KEY MAIN_VITE_SENTRY_DSN=YOUR_SENTRY_DSN SENTRY_AUTH_TOKEN= diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index 5a8824fd3..952a21758 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -106,7 +106,7 @@ export class WindowManager { }); authWindow.loadURL( - `https://auth.hydralauncher.gg/?${searchParams.toString()}` + `${process.env.MAIN_VITE_AUTH_URL}/?${searchParams.toString()}` ); authWindow.once("ready-to-show", () => { From 81e74f068f686f01eca942fac6a2ec0c35701190 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Sun, 22 Sep 2024 16:25:16 -0300 Subject: [PATCH 3/4] fix: import correctly vite env --- src/main/services/window-manager.ts | 2 +- src/main/vite-env.d.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index 952a21758..905e4b655 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -106,7 +106,7 @@ export class WindowManager { }); authWindow.loadURL( - `${process.env.MAIN_VITE_AUTH_URL}/?${searchParams.toString()}` + `${import.meta.env.MAIN_VITE_AUTH_URL}/?${searchParams.toString()}` ); authWindow.once("ready-to-show", () => { diff --git a/src/main/vite-env.d.ts b/src/main/vite-env.d.ts index ff518e827..41f54e24f 100644 --- a/src/main/vite-env.d.ts +++ b/src/main/vite-env.d.ts @@ -3,6 +3,7 @@ interface ImportMetaEnv { readonly MAIN_VITE_STEAMGRIDDB_API_KEY: string; readonly MAIN_VITE_API_URL: string; + readonly MAIN_VITE_AUTH_URL: string; readonly MAIN_VITE_SENTRY_DSN: string; } From 5e55c05bd7ac259d5c770cce8e2f6c4d27f0426f Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Sun, 22 Sep 2024 16:30:47 -0300 Subject: [PATCH 4/4] chore: i18n for friend code --- src/locales/en/translation.json | 3 ++- src/locales/pt-BR/translation.json | 3 ++- src/locales/pt-PT/translation.json | 3 ++- .../shared-modals/user-friend-modal/user-friend-modal.tsx | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 312b18704..784da11ea 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -311,6 +311,7 @@ "report_reason_violence": "Violence", "report_reason_spam": "Spam", "report_reason_other": "Other", - "profile_reported": "Profile reported" + "profile_reported": "Profile reported", + "your_friend_code": "Your friend code:" } } diff --git a/src/locales/pt-BR/translation.json b/src/locales/pt-BR/translation.json index 168e5b5f4..fcb18659f 100644 --- a/src/locales/pt-BR/translation.json +++ b/src/locales/pt-BR/translation.json @@ -315,6 +315,7 @@ "report_reason_violence": "Violência", "report_reason_spam": "Spam", "report_reason_other": "Outro", - "profile_reported": "Perfil reportado" + "profile_reported": "Perfil reportado", + "your_friend_code": "Seu código de amigo:" } } diff --git a/src/locales/pt-PT/translation.json b/src/locales/pt-PT/translation.json index 7e16f7620..85c1a3c5d 100644 --- a/src/locales/pt-PT/translation.json +++ b/src/locales/pt-PT/translation.json @@ -275,6 +275,7 @@ "no_pending_invites": "Não tens convites de amizade pendentes", "no_blocked_users": "Não tens nenhum utilizador bloqueado", "friend_code_copied": "Código de amigo copiado", - "image_process_failure": "Falha ao processar a imagem" + "image_process_failure": "Falha ao processar a imagem", + "your_friend_code": "Seu código de amigo:" } } diff --git a/src/renderer/src/pages/shared-modals/user-friend-modal/user-friend-modal.tsx b/src/renderer/src/pages/shared-modals/user-friend-modal/user-friend-modal.tsx index 26c63abc5..d827fa202 100644 --- a/src/renderer/src/pages/shared-modals/user-friend-modal/user-friend-modal.tsx +++ b/src/renderer/src/pages/shared-modals/user-friend-modal/user-friend-modal.tsx @@ -81,7 +81,7 @@ export const UserFriendModal = ({ alignItems: "center", }} > -
Seu código de amigo:
+{t("your_friend_code")}