From 8a67492cf8c9c6e0cfa51a1c4362e37ee9c99fc8 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Fri, 8 Nov 2024 19:47:28 -0300 Subject: [PATCH 01/43] feat: add userid to itercom and post to logout --- src/main/services/hydra-api.ts | 2 ++ src/renderer/src/components/sidebar/sidebar.tsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main/services/hydra-api.ts b/src/main/services/hydra-api.ts index e3e772e8..b2125ac4 100644 --- a/src/main/services/hydra-api.ts +++ b/src/main/services/hydra-api.ts @@ -112,6 +112,8 @@ export class HydraApi { expirationTimestamp: 0, subscription: null, }; + + this.post("/auth/logout", {}, { needsAuth: false }).catch(() => {}); } static async setupApi() { diff --git a/src/renderer/src/components/sidebar/sidebar.tsx b/src/renderer/src/components/sidebar/sidebar.tsx index b43c216a..5c1d2a66 100644 --- a/src/renderer/src/components/sidebar/sidebar.tsx +++ b/src/renderer/src/components/sidebar/sidebar.tsx @@ -55,8 +55,10 @@ export function Sidebar() { useEffect(() => { if (userDetails) { update({ + user_id: userDetails.id, name: userDetails.displayName, Username: userDetails.username, + email: userDetails.email ?? undefined, Email: userDetails.email, "Subscription expiration date": userDetails?.subscription?.expiresAt, "Payment status": userDetails?.subscription?.status, From e277af0e4be3e05492173836669412d3894a6a54 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Fri, 8 Nov 2024 20:01:56 -0300 Subject: [PATCH 02/43] feat: add staging info on bottom panel --- src/main/constants.ts | 8 ++++---- src/renderer/src/app.tsx | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/constants.ts b/src/main/constants.ts index 2b92b719..b98b5935 100644 --- a/src/main/constants.ts +++ b/src/main/constants.ts @@ -5,12 +5,12 @@ export const LUDUSAVI_MANIFEST_URL = "https://cdn.losbroxas.org/manifest.yaml"; export const defaultDownloadsPath = app.getPath("downloads"); +export const isStaging = import.meta.env.MAIN_VITE_API_URL.includes("staging"); + export const databaseDirectory = path.join(app.getPath("appData"), "hydra"); export const databasePath = path.join( databaseDirectory, - import.meta.env.MAIN_VITE_API_URL.includes("staging") - ? "hydra_test.db" - : "hydra.db" + isStaging ? "hydra_test.db" : "hydra.db" ); export const logsPath = path.join(app.getPath("appData"), "hydra", "logs"); @@ -25,4 +25,4 @@ export const achievementSoundPath = app.isPackaged export const backupsPath = path.join(app.getPath("userData"), "Backups"); -export const appVersion = app.getVersion(); +export const appVersion = app.getVersion() + (isStaging ? "-staging" : ""); diff --git a/src/renderer/src/app.tsx b/src/renderer/src/app.tsx index bf726e31..5a479879 100644 --- a/src/renderer/src/app.tsx +++ b/src/renderer/src/app.tsx @@ -36,8 +36,6 @@ export interface AppProps { children: React.ReactNode; } -console.log(import.meta.env); - Intercom({ app_id: import.meta.env.RENDERER_VITE_INTERCOM_APP_ID, }); From eeae140a41223847a45f1b66dea6c5aa2186a2c1 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Fri, 8 Nov 2024 20:17:12 -0300 Subject: [PATCH 03/43] chore: remove unused file --- .../src/assets/lottie/downloading.json | 843 ------------------ 1 file changed, 843 deletions(-) delete mode 100644 src/renderer/src/assets/lottie/downloading.json diff --git a/src/renderer/src/assets/lottie/downloading.json b/src/renderer/src/assets/lottie/downloading.json deleted file mode 100644 index 1ef705de..00000000 --- a/src/renderer/src/assets/lottie/downloading.json +++ /dev/null @@ -1,843 +0,0 @@ -{ - "v": "4.8.0", - "meta": { "g": "LottieFiles AE 3.5.6", "a": "", "k": "", "d": "", "tc": "" }, - "fr": 60, - "ip": 0, - "op": 120, - "w": 714, - "h": 678, - "nm": "Pre-comp 1", - "ddd": 0, - "assets": [ - { - "id": "comp_0", - "layers": [ - { - "ddd": 0, - "ind": 1, - "ty": 4, - "nm": "centro", - "sr": 1, - "ks": { - "o": { "a": 0, "k": 100, "ix": 11 }, - "r": { "a": 0, "k": 0, "ix": 10 }, - "p": { - "a": 1, - "k": [ - { - "i": { "x": 0.214, "y": 1 }, - "o": { "x": 0.462, "y": 0 }, - "t": 0, - "s": [450, 907, 0], - "to": [0, 0, 0], - "ti": [0, 0, 0] - }, - { "t": 30, "s": [450, 1513, 0] } - ], - "ix": 2 - }, - "a": { "a": 0, "k": [-348, -169, 0], "ix": 1 }, - "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } - }, - "ao": 0, - "shapes": [ - { - "ty": "gr", - "it": [ - { - "ind": 0, - "ty": "sh", - "ix": 1, - "ks": { - "a": 0, - "k": { - "i": [ - [0, 0], - [0, 0] - ], - "o": [ - [0, 0], - [0, 0] - ], - "v": [ - [-348, -420], - [-348, -30] - ], - "c": false - }, - "ix": 2 - }, - "nm": "Path 1", - "mn": "ADBE Vector Shape - Group", - "hd": false - }, - { - "ty": "st", - "c": { - "a": 0, - "k": [0.854901960784, 0.858823529412, 0.882352941176, 1], - "ix": 3 - }, - "o": { "a": 0, "k": 100, "ix": 4 }, - "w": { "a": 0, "k": 77, "ix": 5 }, - "lc": 2, - "lj": 1, - "ml": 4, - "bm": 0, - "nm": "Stroke 1", - "mn": "ADBE Vector Graphic - Stroke", - "hd": false - }, - { - "ty": "tr", - "p": { "a": 0, "k": [-348, -164], "ix": 2 }, - "a": { "a": 0, "k": [-348, -156], "ix": 1 }, - "s": { "a": 0, "k": [100, 100], "ix": 3 }, - "r": { "a": 0, "k": 0, "ix": 6 }, - "o": { "a": 0, "k": 100, "ix": 7 }, - "sk": { "a": 0, "k": 0, "ix": 4 }, - "sa": { "a": 0, "k": 0, "ix": 5 }, - "nm": "Transform" - } - ], - "nm": "Shape 1", - "np": 3, - "cix": 2, - "bm": 0, - "ix": 1, - "mn": "ADBE Vector Group", - "hd": false - } - ], - "ip": 0, - "op": 120, - "st": 0, - "bm": 0 - }, - { - "ddd": 0, - "ind": 2, - "ty": 4, - "nm": "esquerdo", - "parent": 1, - "sr": 1, - "ks": { - "o": { "a": 0, "k": 100, "ix": 11 }, - "r": { - "a": 1, - "k": [ - { - "i": { "x": [0.298], "y": [1] }, - "o": { "x": [0.448], "y": [0] }, - "t": 6, - "s": [43.5] - }, - { "t": 36, "s": [-1] } - ], - "ix": 10 - }, - "p": { "a": 0, "k": [-348.39, -36.55, 0], "ix": 2 }, - "a": { "a": 0, "k": [-2, 84, 0], "ix": 1 }, - "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } - }, - "ao": 0, - "shapes": [ - { - "ty": "gr", - "it": [ - { - "ind": 0, - "ty": "sh", - "ix": 1, - "ks": { - "a": 0, - "k": { - "i": [ - [0, 0], - [0, 0] - ], - "o": [ - [0, 0], - [0, 0] - ], - "v": [ - [-178, -102], - [-2, 84] - ], - "c": false - }, - "ix": 2 - }, - "nm": "Path 1", - "mn": "ADBE Vector Shape - Group", - "hd": false - }, - { - "ty": "st", - "c": { - "a": 0, - "k": [0.854901960784, 0.858823529412, 0.882352941176, 1], - "ix": 3 - }, - "o": { "a": 0, "k": 100, "ix": 4 }, - "w": { "a": 0, "k": 77, "ix": 5 }, - "lc": 2, - "lj": 1, - "ml": 4, - "bm": 0, - "nm": "Stroke 1", - "mn": "ADBE Vector Graphic - Stroke", - "hd": false - }, - { - "ty": "tr", - "p": { "a": 0, "k": [0, 0], "ix": 2 }, - "a": { "a": 0, "k": [0, 0], "ix": 1 }, - "s": { "a": 0, "k": [100, 100], "ix": 3 }, - "r": { "a": 0, "k": 0, "ix": 6 }, - "o": { "a": 0, "k": 100, "ix": 7 }, - "sk": { "a": 0, "k": 0, "ix": 4 }, - "sa": { "a": 0, "k": 0, "ix": 5 }, - "nm": "Transform" - } - ], - "nm": "Shape 1", - "np": 3, - "cix": 2, - "bm": 0, - "ix": 1, - "mn": "ADBE Vector Group", - "hd": false - }, - { - "ty": "tm", - "s": { "a": 0, "k": 8, "ix": 1 }, - "e": { "a": 0, "k": 100, "ix": 2 }, - "o": { "a": 0, "k": 0, "ix": 3 }, - "m": 1, - "ix": 2, - "nm": "Trim Paths 1", - "mn": "ADBE Vector Filter - Trim", - "hd": false - } - ], - "ip": 0, - "op": 120, - "st": 0, - "bm": 0 - }, - { - "ddd": 0, - "ind": 3, - "ty": 4, - "nm": "direito", - "parent": 1, - "sr": 1, - "ks": { - "o": { "a": 0, "k": 100, "ix": 11 }, - "r": { - "a": 1, - "k": [ - { - "i": { "x": [0.265], "y": [1] }, - "o": { "x": [0.53], "y": [0] }, - "t": 6, - "s": [-43.5] - }, - { "t": 36, "s": [1] } - ], - "ix": 10 - }, - "p": { "a": 0, "k": [-348.39, -36.55, 0], "ix": 2 }, - "a": { "a": 0, "k": [-2, 84, 0], "ix": 1 }, - "s": { "a": 0, "k": [-100, 100, 100], "ix": 6 } - }, - "ao": 0, - "shapes": [ - { - "ty": "gr", - "it": [ - { - "ind": 0, - "ty": "sh", - "ix": 1, - "ks": { - "a": 0, - "k": { - "i": [ - [0, 0], - [0, 0] - ], - "o": [ - [0, 0], - [0, 0] - ], - "v": [ - [-178, -102], - [-2, 84] - ], - "c": false - }, - "ix": 2 - }, - "nm": "Path 1", - "mn": "ADBE Vector Shape - Group", - "hd": false - }, - { - "ty": "tm", - "s": { "a": 0, "k": 8, "ix": 1 }, - "e": { "a": 0, "k": 100, "ix": 2 }, - "o": { "a": 0, "k": 0, "ix": 3 }, - "m": 1, - "ix": 2, - "nm": "Trim Paths 1", - "mn": "ADBE Vector Filter - Trim", - "hd": false - }, - { - "ty": "st", - "c": { - "a": 0, - "k": [0.854901960784, 0.858823529412, 0.882352941176, 1], - "ix": 3 - }, - "o": { "a": 0, "k": 100, "ix": 4 }, - "w": { "a": 0, "k": 77, "ix": 5 }, - "lc": 2, - "lj": 1, - "ml": 4, - "bm": 0, - "nm": "Stroke 1", - "mn": "ADBE Vector Graphic - Stroke", - "hd": false - }, - { - "ty": "tr", - "p": { "a": 0, "k": [0, 0], "ix": 2 }, - "a": { "a": 0, "k": [0, 0], "ix": 1 }, - "s": { "a": 0, "k": [100, 100], "ix": 3 }, - "r": { "a": 0, "k": 0, "ix": 6 }, - "o": { "a": 0, "k": 100, "ix": 7 }, - "sk": { "a": 0, "k": 0, "ix": 4 }, - "sa": { "a": 0, "k": 0, "ix": 5 }, - "nm": "Transform" - } - ], - "nm": "Shape 1", - "np": 4, - "cix": 2, - "bm": 0, - "ix": 1, - "mn": "ADBE Vector Group", - "hd": false - } - ], - "ip": 0, - "op": 120, - "st": 0, - "bm": 0 - } - ] - }, - { - "id": "comp_1", - "layers": [ - { - "ddd": 0, - "ind": 1, - "ty": 4, - "nm": "centro", - "sr": 1, - "ks": { - "o": { "a": 0, "k": 100, "ix": 11 }, - "r": { "a": 0, "k": 0, "ix": 10 }, - "p": { - "a": 1, - "k": [ - { - "i": { "x": 0.569, "y": 1 }, - "o": { "x": 0.809, "y": 0 }, - "t": 0, - "s": [450, 391, 0], - "to": [0, 0, 0], - "ti": [0, 0, 0] - }, - { "t": 30, "s": [450, 997, 0] } - ], - "ix": 2 - }, - "a": { "a": 0, "k": [-348, -169, 0], "ix": 1 }, - "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } - }, - "ao": 0, - "shapes": [ - { - "ty": "gr", - "it": [ - { - "ind": 0, - "ty": "sh", - "ix": 1, - "ks": { - "a": 0, - "k": { - "i": [ - [0, 0], - [0, 0] - ], - "o": [ - [0, 0], - [0, 0] - ], - "v": [ - [-348, -420], - [-348, -30] - ], - "c": false - }, - "ix": 2 - }, - "nm": "Path 1", - "mn": "ADBE Vector Shape - Group", - "hd": false - }, - { - "ty": "st", - "c": { - "a": 0, - "k": [0.854901960784, 0.858823529412, 0.882352941176, 1], - "ix": 3 - }, - "o": { "a": 0, "k": 100, "ix": 4 }, - "w": { "a": 0, "k": 77, "ix": 5 }, - "lc": 2, - "lj": 1, - "ml": 4, - "bm": 0, - "nm": "Stroke 1", - "mn": "ADBE Vector Graphic - Stroke", - "hd": false - }, - { - "ty": "tr", - "p": { "a": 0, "k": [-348, -164], "ix": 2 }, - "a": { "a": 0, "k": [-348, -156], "ix": 1 }, - "s": { "a": 0, "k": [100, 100], "ix": 3 }, - "r": { "a": 0, "k": 0, "ix": 6 }, - "o": { "a": 0, "k": 100, "ix": 7 }, - "sk": { "a": 0, "k": 0, "ix": 4 }, - "sa": { "a": 0, "k": 0, "ix": 5 }, - "nm": "Transform" - } - ], - "nm": "Shape 1", - "np": 3, - "cix": 2, - "bm": 0, - "ix": 1, - "mn": "ADBE Vector Group", - "hd": false - } - ], - "ip": 0, - "op": 120, - "st": 0, - "bm": 0 - }, - { - "ddd": 0, - "ind": 2, - "ty": 4, - "nm": "esquerdo", - "parent": 1, - "sr": 1, - "ks": { - "o": { "a": 0, "k": 100, "ix": 11 }, - "r": { - "a": 1, - "k": [ - { - "i": { "x": [0.552], "y": [1] }, - "o": { "x": [0.702], "y": [0] }, - "t": 0, - "s": [-1] - }, - { "t": 30, "s": [43.5] } - ], - "ix": 10 - }, - "p": { "a": 0, "k": [-348.39, -36.55, 0], "ix": 2 }, - "a": { "a": 0, "k": [-2, 84, 0], "ix": 1 }, - "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } - }, - "ao": 0, - "shapes": [ - { - "ty": "gr", - "it": [ - { - "ind": 0, - "ty": "sh", - "ix": 1, - "ks": { - "a": 0, - "k": { - "i": [ - [0, 0], - [0, 0] - ], - "o": [ - [0, 0], - [0, 0] - ], - "v": [ - [-178, -102], - [-2, 84] - ], - "c": false - }, - "ix": 2 - }, - "nm": "Path 1", - "mn": "ADBE Vector Shape - Group", - "hd": false - }, - { - "ty": "st", - "c": { - "a": 0, - "k": [0.854901960784, 0.858823529412, 0.882352941176, 1], - "ix": 3 - }, - "o": { "a": 0, "k": 100, "ix": 4 }, - "w": { "a": 0, "k": 77, "ix": 5 }, - "lc": 2, - "lj": 1, - "ml": 4, - "bm": 0, - "nm": "Stroke 1", - "mn": "ADBE Vector Graphic - Stroke", - "hd": false - }, - { - "ty": "tr", - "p": { "a": 0, "k": [0, 0], "ix": 2 }, - "a": { "a": 0, "k": [0, 0], "ix": 1 }, - "s": { "a": 0, "k": [100, 100], "ix": 3 }, - "r": { "a": 0, "k": 0, "ix": 6 }, - "o": { "a": 0, "k": 100, "ix": 7 }, - "sk": { "a": 0, "k": 0, "ix": 4 }, - "sa": { "a": 0, "k": 0, "ix": 5 }, - "nm": "Transform" - } - ], - "nm": "Shape 1", - "np": 3, - "cix": 2, - "bm": 0, - "ix": 1, - "mn": "ADBE Vector Group", - "hd": false - }, - { - "ty": "tm", - "s": { "a": 0, "k": 8, "ix": 1 }, - "e": { "a": 0, "k": 100, "ix": 2 }, - "o": { "a": 0, "k": 0, "ix": 3 }, - "m": 1, - "ix": 2, - "nm": "Trim Paths 1", - "mn": "ADBE Vector Filter - Trim", - "hd": false - } - ], - "ip": 0, - "op": 120, - "st": 0, - "bm": 0 - }, - { - "ddd": 0, - "ind": 3, - "ty": 4, - "nm": "direito", - "parent": 1, - "sr": 1, - "ks": { - "o": { "a": 0, "k": 100, "ix": 11 }, - "r": { - "a": 1, - "k": [ - { - "i": { "x": [0.47], "y": [1] }, - "o": { "x": [0.735], "y": [0] }, - "t": 0, - "s": [1] - }, - { "t": 30, "s": [-43.5] } - ], - "ix": 10 - }, - "p": { "a": 0, "k": [-348.39, -36.55, 0], "ix": 2 }, - "a": { "a": 0, "k": [-2, 84, 0], "ix": 1 }, - "s": { "a": 0, "k": [-100, 100, 100], "ix": 6 } - }, - "ao": 0, - "shapes": [ - { - "ty": "gr", - "it": [ - { - "ind": 0, - "ty": "sh", - "ix": 1, - "ks": { - "a": 0, - "k": { - "i": [ - [0, 0], - [0, 0] - ], - "o": [ - [0, 0], - [0, 0] - ], - "v": [ - [-178, -102], - [-2, 84] - ], - "c": false - }, - "ix": 2 - }, - "nm": "Path 1", - "mn": "ADBE Vector Shape - Group", - "hd": false - }, - { - "ty": "tm", - "s": { "a": 0, "k": 8, "ix": 1 }, - "e": { "a": 0, "k": 100, "ix": 2 }, - "o": { "a": 0, "k": 0, "ix": 3 }, - "m": 1, - "ix": 2, - "nm": "Trim Paths 1", - "mn": "ADBE Vector Filter - Trim", - "hd": false - }, - { - "ty": "st", - "c": { - "a": 0, - "k": [0.854901960784, 0.858823529412, 0.882352941176, 1], - "ix": 3 - }, - "o": { "a": 0, "k": 100, "ix": 4 }, - "w": { "a": 0, "k": 77, "ix": 5 }, - "lc": 2, - "lj": 1, - "ml": 4, - "bm": 0, - "nm": "Stroke 1", - "mn": "ADBE Vector Graphic - Stroke", - "hd": false - }, - { - "ty": "tr", - "p": { "a": 0, "k": [0, 0], "ix": 2 }, - "a": { "a": 0, "k": [0, 0], "ix": 1 }, - "s": { "a": 0, "k": [100, 100], "ix": 3 }, - "r": { "a": 0, "k": 0, "ix": 6 }, - "o": { "a": 0, "k": 100, "ix": 7 }, - "sk": { "a": 0, "k": 0, "ix": 4 }, - "sa": { "a": 0, "k": 0, "ix": 5 }, - "nm": "Transform" - } - ], - "nm": "Shape 1", - "np": 4, - "cix": 2, - "bm": 0, - "ix": 1, - "mn": "ADBE Vector Group", - "hd": false - } - ], - "ip": 0, - "op": 120, - "st": 0, - "bm": 0 - } - ] - } - ], - "layers": [ - { - "ddd": 0, - "ind": 1, - "ty": 0, - "nm": "seta 2", - "refId": "comp_0", - "sr": 1, - "ks": { - "o": { "a": 0, "k": 100, "ix": 11 }, - "r": { "a": 0, "k": 0, "ix": 10 }, - "p": { "a": 0, "k": [357, -247, 0], "ix": 2 }, - "a": { "a": 0, "k": [450, 960, 0], "ix": 1 }, - "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } - }, - "ao": 0, - "w": 900, - "h": 1920, - "ip": 30, - "op": 120, - "st": 30, - "bm": 0 - }, - { - "ddd": 0, - "ind": 2, - "ty": 0, - "nm": "seta", - "refId": "comp_1", - "sr": 1, - "ks": { - "o": { "a": 0, "k": 100, "ix": 11 }, - "r": { "a": 0, "k": 0, "ix": 10 }, - "p": { "a": 0, "k": [357, 258, 0], "ix": 2 }, - "a": { "a": 0, "k": [450, 345, 0], "ix": 1 }, - "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } - }, - "ao": 0, - "w": 900, - "h": 690, - "ip": 0, - "op": 120, - "st": 0, - "bm": 0 - }, - { - "ddd": 0, - "ind": 3, - "ty": 4, - "nm": "base Outlines", - "sr": 1, - "ks": { - "o": { "a": 0, "k": 100, "ix": 11 }, - "r": { "a": 0, "k": 0, "ix": 10 }, - "p": { "a": 0, "k": [357, 548.713, 0], "ix": 2 }, - "a": { "a": 0, "k": [357.81, 129.934, 0], "ix": 1 }, - "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } - }, - "ao": 0, - "shapes": [ - { - "ty": "gr", - "it": [ - { - "ind": 0, - "ty": "sh", - "ix": 1, - "ks": { - "a": 0, - "k": { - "i": [ - [0, 0], - [0, 50.043], - [0, 0], - [-21.158, 0], - [0, -21.447], - [0, 0], - [-7.049, 0], - [0, 0], - [0, 7.149], - [0, 0], - [-21.158, 0], - [0, -21.447], - [0, 0], - [49.368, 0] - ], - "o": [ - [-49.369, 0], - [0, 0], - [0, -21.447], - [21.158, 0], - [0, 0], - [0, 7.145], - [0, 0], - [7.053, 0], - [0, 0], - [0, -21.447], - [21.158, 0], - [0, 0], - [0, 50.043], - [0, 0] - ], - "v": [ - [-268.169, 129.445], - [-357.559, 38.834], - [-357.559, -90.61], - [-319.249, -129.445], - [-280.939, -90.61], - [-280.939, 38.834], - [-268.169, 51.778], - [268.169, 51.778], - [280.939, 38.834], - [280.939, -90.61], - [319.249, -129.445], - [357.559, -90.61], - [357.559, 38.834], - [268.169, 129.445] - ], - "c": true - }, - "ix": 2 - }, - "nm": "Path 1", - "mn": "ADBE Vector Shape - Group", - "hd": false - }, - { - "ty": "fl", - "c": { - "a": 0, - "k": [0.865977448108, 0.86824388691, 0.890449075138, 1], - "ix": 4 - }, - "o": { "a": 0, "k": 100, "ix": 5 }, - "r": 1, - "bm": 0, - "nm": "Fill 1", - "mn": "ADBE Vector Graphic - Fill", - "hd": false - }, - { - "ty": "tr", - "p": { "a": 0, "k": [357.809, 129.695], "ix": 2 }, - "a": { "a": 0, "k": [0, 0], "ix": 1 }, - "s": { "a": 0, "k": [100, 100], "ix": 3 }, - "r": { "a": 0, "k": 0, "ix": 6 }, - "o": { "a": 0, "k": 100, "ix": 7 }, - "sk": { "a": 0, "k": 0, "ix": 4 }, - "sa": { "a": 0, "k": 0, "ix": 5 }, - "nm": "Transform" - } - ], - "nm": "Group 1", - "np": 2, - "cix": 2, - "bm": 0, - "ix": 1, - "mn": "ADBE Vector Group", - "hd": false - } - ], - "ip": 0, - "op": 120, - "st": 0, - "bm": 0 - } - ], - "markers": [] -} From 34ec8467ec8122d6970e5700eed85961f1136f98 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Fri, 8 Nov 2024 22:34:58 -0300 Subject: [PATCH 04/43] feat: temp removing userId intercom --- src/renderer/src/components/sidebar/sidebar.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/renderer/src/components/sidebar/sidebar.tsx b/src/renderer/src/components/sidebar/sidebar.tsx index 5c1d2a66..75bd1b78 100644 --- a/src/renderer/src/components/sidebar/sidebar.tsx +++ b/src/renderer/src/components/sidebar/sidebar.tsx @@ -55,7 +55,6 @@ export function Sidebar() { useEffect(() => { if (userDetails) { update({ - user_id: userDetails.id, name: userDetails.displayName, Username: userDetails.username, email: userDetails.email ?? undefined, From 77e9de704da1590d5e1f6c79755e29f9151b95cd Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Fri, 8 Nov 2024 22:40:30 -0300 Subject: [PATCH 05/43] feat: open checkout with user language --- src/main/events/misc/open-checkout.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/events/misc/open-checkout.ts b/src/main/events/misc/open-checkout.ts index ba48f03b..5d087be0 100644 --- a/src/main/events/misc/open-checkout.ts +++ b/src/main/events/misc/open-checkout.ts @@ -1,10 +1,16 @@ import { shell } from "electron"; import { registerEvent } from "../register-event"; -import { userAuthRepository } from "@main/repository"; +import { + userAuthRepository, + userPreferencesRepository, +} from "@main/repository"; import { HydraApi } from "@main/services"; const openCheckout = async (_event: Electron.IpcMainInvokeEvent) => { - const userAuth = await userAuthRepository.findOne({ where: { id: 1 } }); + const [userAuth, userPreferences] = await Promise.all([ + userAuthRepository.findOne({ where: { id: 1 } }), + userPreferencesRepository.findOne({ where: { id: 1 } }), + ]); if (!userAuth) { return; @@ -16,6 +22,7 @@ const openCheckout = async (_event: Electron.IpcMainInvokeEvent) => { const params = new URLSearchParams({ token: paymentToken, + lng: userPreferences?.language || "en", }); shell.openExternal( From 341903fc3e3ab72049e8402501faa715e760554a Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Sat, 9 Nov 2024 04:26:01 +0000 Subject: [PATCH 06/43] ci: pushing builds to r2 --- .github/workflows/build.yml | 13 +++++++++++++ .../src/components/bottom-panel/bottom-panel.scss | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 21e184fe..89392011 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,9 @@ name: Build on: pull_request +env: + AWS_REGION: us-east-1 + jobs: build: strategy: @@ -19,6 +22,16 @@ jobs: with: node-version: 20.18.0 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + + - name: Push build to R2 + run: aws s3 sync ./docs s3://${{ vars.BUILDS_BUCKET_NAME }} + - name: Install dependencies run: yarn diff --git a/src/renderer/src/components/bottom-panel/bottom-panel.scss b/src/renderer/src/components/bottom-panel/bottom-panel.scss index 35a1a0ee..5103e916 100644 --- a/src/renderer/src/components/bottom-panel/bottom-panel.scss +++ b/src/renderer/src/components/bottom-panel/bottom-panel.scss @@ -1,7 +1,7 @@ @use "../../scss/globals.scss"; .bottom-panel { - width: "100%"; + width: 100%; border-top: solid 1px globals.$border-color; background-color: globals.$background-color; padding: calc(globals.$spacing-unit / 2) calc(globals.$spacing-unit * 2); From 2828640ed748199ed08ebe0fbb18d8a996ac187d Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Sat, 9 Nov 2024 02:42:43 -0300 Subject: [PATCH 07/43] feat: add intercom user id --- src/main/events/index.ts | 3 ++- src/preload/index.ts | 1 + src/renderer/src/components/sidebar/sidebar.tsx | 17 ++++++++++------- src/renderer/src/declaration.d.ts | 1 + 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main/events/index.ts b/src/main/events/index.ts index 932b80e4..eff62531 100644 --- a/src/main/events/index.ts +++ b/src/main/events/index.ts @@ -1,4 +1,4 @@ -import { appVersion, defaultDownloadsPath } from "@main/constants"; +import { appVersion, defaultDownloadsPath, isStaging } from "@main/constants"; import { ipcMain } from "electron"; import "./catalogue/get-catalogue"; @@ -72,5 +72,6 @@ import "./misc/show-item-in-folder"; ipcMain.handle("ping", () => "pong"); ipcMain.handle("getVersion", () => appVersion); +ipcMain.handle("isStaging", () => isStaging); ipcMain.handle("isPortableVersion", () => isPortableVersion()); ipcMain.handle("getDefaultDownloadsPath", () => defaultDownloadsPath); diff --git a/src/preload/index.ts b/src/preload/index.ts index d8d142ca..0166ba2a 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -198,6 +198,7 @@ contextBridge.exposeInMainWorld("electron", { ping: () => ipcRenderer.invoke("ping"), getVersion: () => ipcRenderer.invoke("getVersion"), getDefaultDownloadsPath: () => ipcRenderer.invoke("getDefaultDownloadsPath"), + isStaging: () => ipcRenderer.invoke("isStaging"), isPortableVersion: () => ipcRenderer.invoke("isPortableVersion"), openExternal: (src: string) => ipcRenderer.invoke("openExternal", src), openCheckout: () => ipcRenderer.invoke("openCheckout"), diff --git a/src/renderer/src/components/sidebar/sidebar.tsx b/src/renderer/src/components/sidebar/sidebar.tsx index 75bd1b78..787cf66a 100644 --- a/src/renderer/src/components/sidebar/sidebar.tsx +++ b/src/renderer/src/components/sidebar/sidebar.tsx @@ -54,13 +54,16 @@ export function Sidebar() { useEffect(() => { if (userDetails) { - update({ - name: userDetails.displayName, - Username: userDetails.username, - email: userDetails.email ?? undefined, - Email: userDetails.email, - "Subscription expiration date": userDetails?.subscription?.expiresAt, - "Payment status": userDetails?.subscription?.status, + window.electron.isStaging().then((isStaging) => { + update({ + user_id: userDetails.id + (isStaging ? "-staging" : ""), + name: userDetails.displayName, + Username: userDetails.username, + email: userDetails.email ?? undefined, + Email: userDetails.email, + "Subscription expiration date": userDetails?.subscription?.expiresAt, + "Payment status": userDetails?.subscription?.status, + }); }); } }, [userDetails, hasActiveSubscription]); diff --git a/src/renderer/src/declaration.d.ts b/src/renderer/src/declaration.d.ts index 4065b64c..a1965b6a 100644 --- a/src/renderer/src/declaration.d.ts +++ b/src/renderer/src/declaration.d.ts @@ -162,6 +162,7 @@ declare global { openExternal: (src: string) => Promise; openCheckout: () => Promise; getVersion: () => Promise; + isStaging: () => Promise; ping: () => string; getDefaultDownloadsPath: () => Promise; isPortableVersion: () => Promise; From 15ecba1f6eb1951f912fc4253544179410eca789 Mon Sep 17 00:00:00 2001 From: bankov4eto <90499490+bankov4eto@users.noreply.github.com> Date: Sat, 9 Nov 2024 15:36:16 +0200 Subject: [PATCH 08/43] Create translation.json Bulgarian translation added --- src/locales/bg/translation.json | 381 ++++++++++++++++++++++++++++++++ 1 file changed, 381 insertions(+) create mode 100644 src/locales/bg/translation.json diff --git a/src/locales/bg/translation.json b/src/locales/bg/translation.json new file mode 100644 index 00000000..85f78cc5 --- /dev/null +++ b/src/locales/bg/translation.json @@ -0,0 +1,381 @@ +{ + "language_name": "Български", + "app": { + "successfully_signed_in": "Успешно вписване" + }, + "home": { + "featured": "Препоръчани", + "surprise_me": "Изненадай ме", + "no_results": "Не са намерени резултати", + "start_typing": "Търсене...", + "hot": "Актуално сега", + "weekly": "📅 Най-доброто от седмицата", + "achievements": "🏆 Игри, които да победите" + }, + "sidebar": { + "catalogue": "Каталог", + "downloads": "Изтегляния", + "settings": "Настройки", + "my_library": "Моята библиотека", + "downloading_metadata": "{{title}} (Сваляне на метаданни…)", + "paused": "{{title}} (Пауза)", + "downloading": "{{title}} ({{percentage}} - Изтегляне…)", + "filter": "Търсене по име", + "home": "Начало", + "queued": "{{title}} (Опашка)", + "game_has_no_executable": "Играта няма избран изпълним файл", + "sign_in": "Вписване", + "friends": "Приятели", + "need_help": "Имате нужда от помощ??" + }, + "header": { + "search": "Търси игри", + "home": "Начало", + "catalogue": "Каталог", + "downloads": "Изтегляния", + "search_results": "Резултати от търсене", + "settings": "Настройки", + "version_available_install": "Версия {{version}} е налична. Кликни тук, за да рестартирате и инсталирате.", + "version_available_download": "Версия {{version}} е налична. Кликни тук за изтегляне." + }, + "bottom_panel": { + "no_downloads_in_progress": "Няма изтегляния в ход", + "downloading_metadata": "Сваляне на {{title}} метадата…", + "downloading": "Изтегляне на {{title}}… ({{percentage}} готово) - Остават {{eta}} - {{speed}}", + "calculating_eta": "Изтегляне на {{title}}… ({{percentage}} готово) - Изчисляване на оставащо време…", + "checking_files": "Проверка на {{title}} файловете… ({{percentage}} готово)" + }, + "catalogue": { + "next_page": "Следваща страница", + "previous_page": "Предишна страница" + }, + "game_details": { + "open_download_options": "Варианти за изтегляне", + "download_options_zero": "Няма варианти за изтегляне", + "download_options_one": "{{count}} варианти за изтегляне", + "download_options_other": "{{count}} варианти за изтегляне", + "updated_at": "Обновено на {{updated_at}}", + "install": "Инсталирай", + "resume": "Продължи", + "pause": "Пауза", + "cancel": "Отказ", + "remove": "Премахни", + "space_left_on_disk": "{{space}} място на диска", + "eta": "Заклчение {{eta}}", + "calculating_eta": "Калкулиране на оставащо време…", + "downloading_metadata": "Изтегляне на метадата…", + "filter": "Филтрирай repacks", + "requirements": "Състемни изисквания", + "minimum": "Минимални", + "recommended": "Препоръчителни", + "paused": "Паузирано", + "release_date": "Издадено на {{date}}", + "publisher": "Публикувано от {{publisher}}", + "hours": "часове", + "minutes": "минути", + "amount_hours": "{{amount}} часа", + "amount_minutes": "{{amount}} минути", + "accuracy": "{{accuracy}}% точност", + "add_to_library": "Добави в библиотеката", + "remove_from_library": "Премахни от библиотеката", + "no_downloads": "Няма налични изтегляния", + "play_time": "Играно {{amount}}", + "last_time_played": "Последно играно {{period}}", + "not_played_yet": "Не сте играли {{title}} все още", + "next_suggestion": "Следващо предложение", + "play": "Пускане", + "deleting": "Изтриване на инсталация…", + "close": "Затвори", + "playing_now": "Играй сега", + "change": "Промяна", + "repacks_modal_description": "Избери repack който искаш да изтеглиш", + "select_folder_hint": "За да промените стандартната папка отидете в <0>Настройки", + "download_now": "Изтегли сега", + "no_shop_details": "Не може да се извлекат данни за магазина.", + "download_options": "Опции за сваляне", + "download_path": "Път за сваляне", + "previous_screenshot": "Предишна снимка", + "next_screenshot": "Следваща снимка", + "screenshot": "Снимка {{number}}", + "open_screenshot": "Отвори снимки {{number}}", + "download_settings": "Настройки за сваляне", + "downloader": "Downloader", + "select_executable": "Избери", + "no_executable_selected": "Няма избран стартиращ файл", + "open_folder": "Отвори папка", + "open_download_location": "Виж свалените файлове", + "create_shortcut": "Пряк път на Десктопа", + "remove_files": "Премахни файловете", + "remove_from_library_title": "Сигурен ли си?", + "remove_from_library_description": "Това ще премахне {{game}} от Библиотеката", + "options": "Опции", + "executable_section_title": "Стартиращ файл", + "executable_section_description": "Пътят на файла, който ще се изпълни, когато се щракне върху \"Играй\“", + "downloads_secion_title": "Свалени", + "downloads_section_description": "Вижте актуализации или други версии на тази игра", + "danger_zone_section_title": "Опасна зона", + "danger_zone_section_description": "Премахнете тази игра от библиотеката си или от файловете, изтеглени от Hydra", + "download_in_progress": "Изтегляне в ход", + "download_paused": "Изтеглянето е паузирано", + "last_downloaded_option": "Опция от последно изтегляне", + "create_shortcut_success": "Прекият път е създаден успешно", + "create_shortcut_error": "Грешка при създаването на пряк път", + "nsfw_content_title": "Тази игра съдържа неподходящо съдържание", + "nsfw_content_description": "{{title}} съдържа съдържание, което може да не е подходящо за всички възрасти. Сигурни ли сте, че искате да продължите?", + "allow_nsfw_content": "Продължи", + "refuse_nsfw_content": "Назад", + "stats": "Статистики", + "download_count": "Сваляния", + "player_count": "Активни играчи", + "download_error": "Тази опция за изтегляне не е налична", + "download": "Свали", + "executable_path_in_use": "Изпълнимият файл вече се използва от \"{{game}}\"", + "warning": "Внимание:", + "hydra_needs_to_remain_open": "за това изтегляне, Hydra трябва да остане отворена, когато е завършено. Ако Hydra се затвори преди завършването, ще загубите напредъка си..", + "achievements": "Постижения", + "achievements_count": "Постижения {{unlockedCount}}/{{achievementsCount}}", + "cloud_save": "Запазване в облака", + "cloud_save_description": "Запазете напредъка си в облака и продължете да играете на всяко устройство", + "backups": "Резервни копия", + "install_backup": "Инсталирай", + "delete_backup": "Изтрий", + "create_backup": "Ново копие", + "last_backup_date": "Последно копие от {{date}}", + "no_backup_preview": "Не бяха намерени запазени игри за това заглавие", + "restoring_backup": "Възстановяване на резервно копие ({{progress}} готово)…", + "uploading_backup": "Качване на резервно копие…", + "no_backups": "Все още не сте създали резервни копия за тази игра", + "backup_uploaded": "Качено резервно копие", + "backup_deleted": "Изтрито резервно копие", + "backup_restored": "Възстановен бекъп", + "see_all_achievements": "Вижте всички постижения", + "sign_in_to_see_achievements": "Влезте, за да видите постиженията", + "mapping_method_automatic": "Автоматично", + "mapping_method_manual": "Ръчно", + "mapping_method_label": "Метод на картографиране", + "files_automatically_mapped": "Автоматично картографиране на файлове", + "no_backups_created": "Не са създадени резервни копия за тази игра", + "manage_files": "Управление на файлове", + "loading_save_preview": "Търсене на запазени игри…", + "wine_prefix": "Wine Префикс", + "wine_prefix_description": "Wine prefix използван за тази игра", + "no_download_option_info": "Няма налични данни", + "backup_deletion_failed": "Неуспешно изтриване на резервно копие", + "max_number_of_artifacts_reached": "Достигнат максимален брой резервни копия за тази игра", + "achievements_not_sync": "Постиженията ви не са синхронизирани", + "manage_files_description": "Управлявайте кои файлове ще бъдат архивирани и възстановени", + "select_folder": "Избери папка", + "backup_from": "Резервно копие от {{date}}", + "custom_backup_location_set": "Задаване на персонализирано местоположение за архивиране" + }, + "activation": { + "title": "Активирай Hydra", + "installation_id": "Идентификатор на инсталацията:", + "enter_activation_code": "Въведете кода за активиране", + "message": "Ако не знаете къде да попитате за това, значи не трябва да го имате..", + "activate": "Активирай", + "loading": "Зареждане…" + }, + "downloads": { + "resume": "Продължи", + "pause": "Пауза", + "eta": "Conclusion {{eta}}", + "paused": "Паузирано", + "verifying": "Проверка…", + "completed": "Готово", + "removed": "Не е изтеглен", + "cancel": "Отказ", + "filter": "Филтриране на изтеглени игри", + "remove": "Премахни", + "downloading_metadata": "Изтегляне на метаданни…", + "deleting": "Изтриване на инсталатора…", + "delete": "Премахване на инсталатора", + "delete_modal_title": "Сигурени ли сте?", + "delete_modal_description": "Това ще премахне всички инсталационни файлове от компютъра ви.", + "install": "Инсталирай", + "download_in_progress": "В процес на изпълнение", + "queued_downloads": "Изтеглени файлове в опашката", + "downloads_completed": "Приключени", + "queued": "В опашка", + "no_downloads_title": "Толкова е празно", + "no_downloads_description": "Все още не сте изтеглили нищо с Hydra, но никога не е късно да започнете..", + "checking_files": "Проверка на файлове…" + }, + "settings": { + "downloads_path": "Инсталационен път", + "change": "Актуализиране", + "notifications": "Известия", + "enable_download_notifications": "Когато изтеглянето е завършено", + "enable_repack_list_notifications": "Когато се добави нов repack", + "real_debrid_api_token_label": "Real-Debrid API токен", + "quit_app_instead_hiding": "Не скривайте Hydra при затваряне", + "launch_with_system": "Стартиране на Hydra при стартиране на системата", + "general": "Общ", + "behavior": "Поведение", + "download_sources": "Източници за изтегляне", + "language": "Език", + "real_debrid_api_token": "API Токен", + "enable_real_debrid": "Включи Real-Debrid", + "real_debrid_description": "Real-Debrid е неограничен даунлоудър, който ви позволява бързо да изтегляте файлове, ограничени само от скоростта на интернет..", + "real_debrid_invalid_token": "Невалиден API токен", + "real_debrid_api_token_hint": "Вземете своя API токен <0>тук", + "real_debrid_free_account_error": "Акаунтът \"{{username}}\" е безплатен акаунт. Моля абонирай се за Real-Debrid", + "real_debrid_linked_message": "Акаунтът \"{{username}}\" е свързан", + "save_changes": "Запази промените", + "changes_saved": "Промените са успешно запазни", + "download_sources_description": „Hydra ще извлича връзките за изтегляне от тези източници. URL адресът на източника трябва да е директна връзка към .json файл, съдържащ връзките за изтегляне.", + "validate_download_source": "Валидиране", + "remove_download_source": "Премахни", + "add_download_source": "Добави източник", + "download_count_zero": "Няма опции за сваляне", + "download_count_one": "{{countFormatted}} опции за сваляне", + "download_count_other": "{{countFormatted}} опции за сваляне", + "download_source_url": "URL адрес на източника за изтегляне", + "add_download_source_description": "Вмъкнете URL адреса на файла .json", + "download_source_up_to_date": "Актуален", + "download_source_errored": "Сгрешен", + "sync_download_sources": "Синхронизирай източниците", + "removed_download_source": "Източника за сваляне е премахнат", + "added_download_source": "Добавен източник за сваляне", + "download_sources_synced": "Всички източници за сваляне са синхронизирани", + "insert_valid_json_url": "Добавете ваиден JSON линк", + "found_download_option_zero": "Няма намерени опции за сваляне", + "found_download_option_one": "Намерени {{countFormatted}} опции за сваляне", + "found_download_option_other": "Намерени {{countFormatted}} опции за сваляне", + "import": "Внеси", + "public": "Публичен", + "private": "Личен", + "friends_only": "Само за приятели", + "privacy": "Поверителност", + "profile_visibility": "Видимост на профила", + "profile_visibility_description": "Изберете кой може да вижда вашия профил и библиотека", + "required_field": "Това поле е задължително", + "source_already_exists": "Този източник вече е добавен", + "must_be_valid_url": "Източникът трябва да е валиден URL адрес.", + "blocked_users": "Блокирани потребители", + "user_unblocked": "Потребителят е бил деблокиран", + "enable_achievement_notifications": "Когато е отключено постижение", + "launch_minimized": "Стартиране на Hydra минимизирано", + "disable_nsfw_alert": "Деактивиране на предупреждението NSFW" + }, + "notifications": { + "download_complete": "Изтеглянето е завършено", + "game_ready_to_install": "{{title}} е готово за инсталиране", + "repack_list_updated": "Repack лист е обновен", + "repack_count_one": "{{count}} repack е добавен", + "repack_count_other": "{{count}} repacks добавени", + "new_update_available": "Версия {{version}} е налична", + "restart_to_install_update": "Рестартирайте Hydra, за да инсталирате актуализацията", + "notification_achievement_unlocked_title": "Отключено постижение за {{game}}", + "notification_achievement_unlocked_body": "{{achievement}} и други {{count}} са отклщчени" + }, + "system_tray": { + "open": "Отвори Hydra", + "quit": "Изход" + }, + "game_card": { + "no_downloads": "Няма налични изтегляния" + }, + "binary_not_found_modal": { + "title": "Не инсталирани програми", + "description": "Wine или Lutris изпълними файлове не бяха открити на вашата система", + "instructions": "Проверете правилния начин за инсталиране на някоя от тях на вашата дистрибуция на Linux, за да може играта да работи нормално" + }, + "modal": { + "close": "Бутон за затваряне" + }, + "forms": { + "toggle_password_visibility": "Превключване на видимостта на паролата" + }, + "user_profile": { + "amount_hours": "{{amount}} часове", + "amount_minutes": "{{amount}} минути", + "last_time_played": "Последно играно {{period}}", + "activity": "Скорошна активност", + "library": "Библиотека", + "total_play_time": "Общо време за игра: {{amount}}", + "no_recent_activity_title": "Хмм… няма нищо тук", + "no_recent_activity_description": "Не сте играли игри напоследък. Време е да промените това.!", + "display_name": "Показване на името", + "saving": "Запазване", + "save": "Запис", + "edit_profile": "Редактиране на профила", + "saved_successfully": "Запазено успешно", + "try_again": "Моля, опитайте пак", + "sign_out_modal_title": "Сигурни ли сте?", + "cancel": "Отказ", + "successfully_signed_out": "Успешно се отписахте", + "sign_out": "Отписване", + "playing_for": "В игра от {{amount}}", + "sign_out_modal_text": "Вашата библиотека е свързана с текущата ви сметка. Когато се отпишете, библиотеката ви вече няма да е видима и напредъкът няма да бъде запазен. Продължете с отписването?", + "add_friends": "Добави приятели", + "add": "Добави", + "friend_code": "Приятелски код", + "see_profile": "Виж профила", + "sending": "Изпращане", + "friend_request_sent": "Изпратена покана за приятелство", + "friends": "Приятели", + "friends_list": "Списък с приятели", + "user_not_found": "Не е намерен потребител", + "block_user": "Блокирай потребител", + "add_friend": "Добави приятел", + "request_sent": "Изпратена покана", + "request_received": "Получена покана", + "accept_request": "Приеми поканата", + "ignore_request": "Игнирирай поканата", + "cancel_request": "Откажи поканата", + "undo_friendship": "Отмяна на приятелството", + "request_accepted": "Поканата е приета", + "user_blocked_successfully": "Потребителят е блокиран успешно", + "user_block_modal_text": "Това ще блокира {{displayName}}", + "blocked_users": "Блокирани потребители", + "unblock": "Отблокирай", + "no_friends_added": "Не сте добавили приятели", + "pending": "Чакащо", + "no_pending_invites": "Нямате чакащи покани", + "no_blocked_users": "Нямате блокирани потребители", + "friend_code_copied": "Приятелския код е копиран", + "undo_friendship_modal_text": "Това ще отмени приятелството ви с {{displayName}}", + "privacy_hint": "За да настроите кой може да вижда това, отидете в <0>Настройки", + "locked_profile": "Този профил е личен", + "image_process_failure": "Грешка при обработката на изображението", + "required_field": "Това поле е задължително", + "displayname_min_length": "Името трябва да е дълго поне 3 символа", + "displayname_max_length": "Името трябва да е с дължина не повече от 50 символа.", + "report_profile": "Докладвай този профил", + "report_reason": "Защо докладвате този профил?", + "report_description": "Допълнителна информация", + "report_description_placeholder": "Допълнителна информация", + "report": "Докладвай", + "report_reason_hate": "Омразна реч", + "report_reason_sexual_content": "Сексуално съдържание", + "report_reason_violence": "Насилия", + "report_reason_spam": "Спам", + "report_reason_other": "Друго", + "profile_reported": "Профилът е докладван", + "your_friend_code": "Вашия приятелски код:", + "upload_banner": "Качи банер", + "uploading_banner": "Качване на банер…", + "background_image_updated": "Обновено фоново изображение" + }, + "achievement": { + "achievement_unlocked": "Постижението е отключено", + "user_achievements": "Постиженията на {{displayName}} ", + "your_achievements": "Вашите Постижения", + "unlocked_at": "Отключено на:", + "subscription_needed": "Необходим е абонамент за Hydra Cloud, за да видите това съдържание", + "new_achievements_unlocked": "Отключени {{achievementCount}} нови постижения от {{gameCount}} игра", + "achievement_progress": "{{unlockedCount}}/{{totalCount}} постижения", + "achievements_unlocked_for_game": "Отключени {{achievementCount}} нови постижения за {{gameTitle}}" + }, + "tour": { + "subscription_tour_title": "Hydra Cloud Абонамент", + "subscribe_now": "Абонирай се сега", + "cloud_saving": "Запазване в облака", + "cloud_achievements": "Запазете постиженията си в облака", + "animated_profile_picture": "Анимирана профилна снимка", + "premium_support": "Премиум поддръжка", + "show_and_compare_achievements": "Показвайте и сравнявайте постиженията си с тези на други потребители", + "animated_profile_banner": "Анимиран профилен банер" + } +} From 7166f66a9ea7c8eea67227fe4e3b5f8752cb423f Mon Sep 17 00:00:00 2001 From: bankov4eto <90499490+bankov4eto@users.noreply.github.com> Date: Sat, 9 Nov 2024 17:29:32 +0200 Subject: [PATCH 09/43] Update translation.json --- 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 85f78cc5..be43fbd8 100644 --- a/src/locales/bg/translation.json +++ b/src/locales/bg/translation.json @@ -223,7 +223,7 @@ "real_debrid_linked_message": "Акаунтът \"{{username}}\" е свързан", "save_changes": "Запази промените", "changes_saved": "Промените са успешно запазни", - "download_sources_description": „Hydra ще извлича връзките за изтегляне от тези източници. URL адресът на източника трябва да е директна връзка към .json файл, съдържащ връзките за изтегляне.", + "download_sources_description": "Hydra ще извлича връзките за изтегляне от тези източници. URL адресът на източника трябва да е директна връзка към .json файл, съдържащ връзките за изтегляне.", "validate_download_source": "Валидиране", "remove_download_source": "Премахни", "add_download_source": "Добави източник", From da1ac788fbc7fb91e6f407507388ee5788047c7b Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Sat, 9 Nov 2024 20:58:21 -0300 Subject: [PATCH 10/43] Update translation.json --- 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 be43fbd8..f9999582 100644 --- a/src/locales/bg/translation.json +++ b/src/locales/bg/translation.json @@ -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": "Опасна зона", From d046f1ed213f589ce30df82dbb514e701c1a8111 Mon Sep 17 00:00:00 2001 From: bankov4eto <90499490+bankov4eto@users.noreply.github.com> Date: Sun, 10 Nov 2024 09:25:19 +0200 Subject: [PATCH 11/43] Update index.ts --- src/locales/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/locales/index.ts b/src/locales/index.ts index 26d15b61..c576c3c4 100644 --- a/src/locales/index.ts +++ b/src/locales/index.ts @@ -24,6 +24,7 @@ import kk from "./kk/translation.json"; import cs from "./cs/translation.json"; import nb from "./nb/translation.json"; import et from "./et/translation.json"; +import bg from "./bg/translation.json"; export default { "pt-BR": ptBR, @@ -48,6 +49,7 @@ export default { fa, ro, ca, + bg, kk, cs, nb, From 6e6469d90f8302686b700c667b7fc98ee37029e3 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Sun, 10 Nov 2024 20:55:23 -0300 Subject: [PATCH 12/43] fix: format ignore case --- src/shared/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/index.ts b/src/shared/index.ts index 173867df..cc35d241 100644 --- a/src/shared/index.ts +++ b/src/shared/index.ts @@ -46,7 +46,7 @@ export const removeSymbolsFromName = (name: string) => export const removeSpecialEditionFromName = (name: string) => name.replace( - /(The |Digital )?(GOTY|Deluxe|Standard|Ultimate|Definitive|Enhanced|Collector's|Premium|Digital|Limited|Game of the Year|Reloaded|[0-9]{4}) Edition/g, + /(The |Digital )?(GOTY|Deluxe|Standard|Ultimate|Definitive|Enhanced|Collector's|Premium|Digital|Limited|Game of the Year|Reloaded|[0-9]{4}) Edition/gi, "" ); @@ -73,7 +73,7 @@ export const formatName = pipe( replaceUnderscoreWithSpace, replaceDotsWithSpace, replaceNbspWithSpace, - (str) => str.replace(/DIRECTOR'S CUT/g, ""), + (str) => str.replace(/DIRECTOR'S CUT/gi, ""), removeSymbolsFromName, removeDuplicateSpaces, (str) => str.trim() From 8cfe5b4d3419b225d7a429927a51b59ce6e28cc6 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Mon, 11 Nov 2024 10:35:33 -0300 Subject: [PATCH 13/43] fix: add friend's pass to format name --- src/shared/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shared/index.ts b/src/shared/index.ts index cc35d241..699cc4d8 100644 --- a/src/shared/index.ts +++ b/src/shared/index.ts @@ -74,6 +74,7 @@ export const formatName = pipe( replaceDotsWithSpace, replaceNbspWithSpace, (str) => str.replace(/DIRECTOR'S CUT/gi, ""), + (str) => str.replace(/Friend's Pass/gi, ""), removeSymbolsFromName, removeDuplicateSpaces, (str) => str.trim() From 7785d420214c6ba48e57babd0b70e86ead13ceb4 Mon Sep 17 00:00:00 2001 From: JackEnx Date: Tue, 12 Nov 2024 15:38:30 -0300 Subject: [PATCH 14/43] fix: linux game tracking and closed button --- .python-version | 1 + src/main/events/library/close-game.ts | 6 +++- src/main/services/download/types.ts | 1 + src/main/services/process-watcher.ts | 44 ++++++++++++++++++++------- torrent-client/main.py | 2 +- 5 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 .python-version diff --git a/.python-version b/.python-version new file mode 100644 index 00000000..94329086 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.9.20 diff --git a/src/main/events/library/close-game.ts b/src/main/events/library/close-game.ts index 9c431d06..48cb681b 100644 --- a/src/main/events/library/close-game.ts +++ b/src/main/events/library/close-game.ts @@ -24,7 +24,11 @@ const closeGame = async ( if (!game) return; const gameProcess = processes.find((runningProcess) => { - return runningProcess.exe === game.executablePath; + if (process.platform === "linux") { + return runningProcess.name === game.executablePath?.split("/").at(-1); + } else { + return runningProcess.exe === game.executablePath; + } }); if (gameProcess) { diff --git a/src/main/services/download/types.ts b/src/main/services/download/types.ts index fd8009a2..3ddaff39 100644 --- a/src/main/services/download/types.ts +++ b/src/main/services/download/types.ts @@ -35,4 +35,5 @@ export interface LibtorrentPayload { export interface ProcessPayload { exe: string; pid: number; + name: string; } diff --git a/src/main/services/process-watcher.ts b/src/main/services/process-watcher.ts index 51b39bbe..23915355 100644 --- a/src/main/services/process-watcher.ts +++ b/src/main/services/process-watcher.ts @@ -25,21 +25,43 @@ export const watchProcesses = async () => { if (games.length === 0) return; const processes = await PythonInstance.getProcessList(); - const processSet = new Set(processes.map((process) => process.exe)); + if (process.platform === "linux") { + const processSet = new Set(processes.map((process) => process.name)); - for (const game of games) { - const executablePath = game.executablePath!; + for (const game of games) { + const executable = game.executablePath?.split("/").at(-1); - const gameProcess = processSet.has(executablePath); + if (!executable) continue; - if (gameProcess) { - if (gamesPlaytime.has(game.id)) { - onTickGame(game); - } else { - onOpenGame(game); + const gameProcess = processSet.has(executable); + + if (gameProcess) { + if (gamesPlaytime.has(game.id)) { + onTickGame(game); + } else { + onOpenGame(game); + } + } else if (gamesPlaytime.has(game.id)) { + onCloseGame(game); + } + } + } else { + const processSet = new Set(processes.map((process) => process.exe)); + + for (const game of games) { + const executablePath = game.executablePath!; + + const gameProcess = processSet.has(executablePath); + + if (gameProcess) { + if (gamesPlaytime.has(game.id)) { + onTickGame(game); + } else { + onOpenGame(game); + } + } else if (gamesPlaytime.has(game.id)) { + onCloseGame(game); } - } else if (gamesPlaytime.has(game.id)) { - onCloseGame(game); } } diff --git a/torrent-client/main.py b/torrent-client/main.py index d62150b8..0e65c564 100644 --- a/torrent-client/main.py +++ b/torrent-client/main.py @@ -60,7 +60,7 @@ class Handler(BaseHTTPRequestHandler): self.end_headers() return - process_list = [proc.info for proc in psutil.process_iter(['exe', 'pid', 'username'])] + process_list = [proc.info for proc in psutil.process_iter(['exe', 'pid', 'name'])] self.send_response(200) self.send_header("Content-type", "application/json") From 46c3b335481c3526306a684a3f5bfb6d033d17b5 Mon Sep 17 00:00:00 2001 From: JackEnx Date: Wed, 13 Nov 2024 11:54:01 -0300 Subject: [PATCH 15/43] refactor: remove process watcher duplicated code --- src/main/services/process-watcher.ts | 59 ++++++++++++---------------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/src/main/services/process-watcher.ts b/src/main/services/process-watcher.ts index 23915355..fd9bb148 100644 --- a/src/main/services/process-watcher.ts +++ b/src/main/services/process-watcher.ts @@ -14,6 +14,20 @@ export const gamesPlaytime = new Map< const TICKS_TO_UPDATE_API = 120; let currentTick = 1; +const getSystemProcessSet = async () => { + const processes = await PythonInstance.getProcessList(); + + if (process.platform === "linux") + return new Set(processes.map((process) => process.name)); + return new Set(processes.map((process) => process.exe)); +}; + +const getExecutable = (game: Game) => { + if (process.platform === "linux") + return game.executablePath?.split("/").at(-1); + return game.executablePath; +}; + export const watchProcesses = async () => { const games = await gameRepository.find({ where: { @@ -23,45 +37,24 @@ export const watchProcesses = async () => { }); if (games.length === 0) return; - const processes = await PythonInstance.getProcessList(); - if (process.platform === "linux") { - const processSet = new Set(processes.map((process) => process.name)); + const processSet = await getSystemProcessSet(); - for (const game of games) { - const executable = game.executablePath?.split("/").at(-1); + for (const game of games) { + const executable = getExecutable(game); - if (!executable) continue; + if (!executable) continue; - const gameProcess = processSet.has(executable); + const gameProcess = processSet.has(executable); - if (gameProcess) { - if (gamesPlaytime.has(game.id)) { - onTickGame(game); - } else { - onOpenGame(game); - } - } else if (gamesPlaytime.has(game.id)) { - onCloseGame(game); - } - } - } else { - const processSet = new Set(processes.map((process) => process.exe)); - - for (const game of games) { - const executablePath = game.executablePath!; - - const gameProcess = processSet.has(executablePath); - - if (gameProcess) { - if (gamesPlaytime.has(game.id)) { - onTickGame(game); - } else { - onOpenGame(game); - } - } else if (gamesPlaytime.has(game.id)) { - onCloseGame(game); + if (gameProcess) { + if (gamesPlaytime.has(game.id)) { + onTickGame(game); + } else { + onOpenGame(game); } + } else if (gamesPlaytime.has(game.id)) { + onCloseGame(game); } } From 948965dda5afcc79c697afcdafebd3361e853f8e Mon Sep 17 00:00:00 2001 From: jarome Date: Sat, 23 Nov 2024 21:39:45 -0300 Subject: [PATCH 16/43] 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 730ea4f2b9c10b7b14a18599184d86d96ef1985a Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Wed, 27 Nov 2024 13:17:40 -0300 Subject: [PATCH 17/43] fix: subscription date validation --- .../events/torrenting/start-game-download.ts | 13 ------- src/main/services/hydra-analytics.ts | 34 ------------------- src/main/services/hydra-api.ts | 7 ++-- src/renderer/src/hooks/use-user-details.ts | 7 ++-- .../cloud-sync-files-modal.tsx | 2 +- 5 files changed, 7 insertions(+), 56 deletions(-) delete mode 100644 src/main/services/hydra-analytics.ts diff --git a/src/main/events/torrenting/start-game-download.ts b/src/main/events/torrenting/start-game-download.ts index 17099450..ce16e97b 100644 --- a/src/main/events/torrenting/start-game-download.ts +++ b/src/main/events/torrenting/start-game-download.ts @@ -1,5 +1,4 @@ import { registerEvent } from "../register-event"; -import parseTorrent from "parse-torrent"; import type { StartGameDownloadPayload } from "@types"; import { DownloadManager, HydraApi, logger } from "@main/services"; @@ -9,7 +8,6 @@ import { createGame } from "@main/services/library-sync"; import { steamUrlBuilder } from "@shared"; import { dataSource } from "@main/data-source"; import { DownloadQueue, Game } from "@main/entity"; -import { HydraAnalytics } from "@main/services/hydra-analytics"; const startGameDownload = async ( _event: Electron.IpcMainInvokeEvent, @@ -91,17 +89,6 @@ const startGameDownload = async ( logger.error("Failed to create game download", err); }); - if (uri.startsWith("magnet:")) { - try { - const { infoHash } = await parseTorrent(payload.uri); - if (infoHash) { - HydraAnalytics.postDownload(infoHash).catch(() => {}); - } - } catch (err) { - logger.error("Failed to parse torrent", err); - } - } - await DownloadManager.cancelDownload(updatedGame!.id); await DownloadManager.startDownload(updatedGame!); diff --git a/src/main/services/hydra-analytics.ts b/src/main/services/hydra-analytics.ts deleted file mode 100644 index f4a6b24c..00000000 --- a/src/main/services/hydra-analytics.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { userSubscriptionRepository } from "@main/repository"; -import axios from "axios"; -import { appVersion } from "@main/constants"; - -export class HydraAnalytics { - private static instance = axios.create({ - baseURL: import.meta.env.MAIN_VITE_ANALYTICS_API_URL, - headers: { "User-Agent": `Hydra Launcher v${appVersion}` }, - }); - - private static async hasActiveSubscription() { - const userSubscription = await userSubscriptionRepository.findOne({ - where: { id: 1 }, - }); - - return ( - userSubscription?.expiresAt && userSubscription.expiresAt > new Date() - ); - } - - static async postDownload(hash: string) { - const hasSubscription = await this.hasActiveSubscription(); - - return this.instance - .post("/track", { - event: "download", - attributes: { - hash, - hasSubscription, - }, - }) - .then((response) => response.data); - } -} diff --git a/src/main/services/hydra-api.ts b/src/main/services/hydra-api.ts index b2125ac4..f642f43b 100644 --- a/src/main/services/hydra-api.ts +++ b/src/main/services/hydra-api.ts @@ -12,6 +12,7 @@ import { UserNotLoggedInError, SubscriptionRequiredError } from "@shared"; import { omit } from "lodash-es"; import { appVersion } from "@main/constants"; import { getUserData } from "./user/get-user-data"; +import { isFuture, isToday } from "date-fns"; interface HydraApiOptions { needsAuth?: boolean; @@ -45,10 +46,8 @@ export class HydraApi { } private static hasActiveSubscription() { - return ( - this.userAuth.subscription?.expiresAt && - this.userAuth.subscription.expiresAt > new Date() - ); + const expiresAt = this.userAuth.subscription?.expiresAt; + return expiresAt && (isFuture(expiresAt) || isToday(expiresAt)); } static async handleExternalAuth(uri: string) { diff --git a/src/renderer/src/hooks/use-user-details.ts b/src/renderer/src/hooks/use-user-details.ts index ab4408cc..feca478c 100644 --- a/src/renderer/src/hooks/use-user-details.ts +++ b/src/renderer/src/hooks/use-user-details.ts @@ -14,6 +14,7 @@ import type { UserDetails, } from "@types"; import { UserFriendModalTab } from "@renderer/pages/shared-modals/user-friend-modal"; +import { isFuture, isToday } from "date-fns"; export function useUserDetails() { const dispatch = useAppDispatch(); @@ -128,10 +129,8 @@ export function useUserDetails() { const unblockUser = (userId: string) => window.electron.unblockUser(userId); const hasActiveSubscription = useMemo(() => { - return ( - userDetails?.subscription?.expiresAt && - new Date(userDetails.subscription.expiresAt) > new Date() - ); + const expiresAt = userDetails?.subscription?.expiresAt; + return expiresAt && (isFuture(expiresAt) || isToday(expiresAt)); }, [userDetails]); return { diff --git a/src/renderer/src/pages/game-details/cloud-sync-files-modal/cloud-sync-files-modal.tsx b/src/renderer/src/pages/game-details/cloud-sync-files-modal/cloud-sync-files-modal.tsx index c70f69b7..6fd277e7 100644 --- a/src/renderer/src/pages/game-details/cloud-sync-files-modal/cloud-sync-files-modal.tsx +++ b/src/renderer/src/pages/game-details/cloud-sync-files-modal/cloud-sync-files-modal.tsx @@ -75,7 +75,7 @@ export function CloudSyncFilesModal({ showSuccessToast(t("custom_backup_location_set")); getGameBackupPreview(); } - }, [objectId, setValue, shop, showSuccessToast, getGameBackupPreview]); + }, [objectId, setValue, shop, showSuccessToast, getGameBackupPreview, t]); const handleFileMappingMethodClick = useCallback( (mappingOption: FileMappingMethod) => { From 7f600a0cbfc55e39c17e31404ce7244cbcc2542b Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Mon, 2 Dec 2024 17:10:13 +0000 Subject: [PATCH 18/43] feat: adding csp update --- .env.example | 1 - .github/workflows/build.yml | 10 ------- src/main/events/index.ts | 3 +- src/preload/index.ts | 3 +- src/renderer/index.html | 6 +++- src/renderer/src/app.tsx | 29 +++++++++++++------ src/renderer/src/components/modal/modal.tsx | 1 + .../src/components/sidebar/sidebar.tsx | 26 ++++------------- src/renderer/src/declaration.d.ts | 3 +- src/renderer/src/vite-env.d.ts | 8 ----- 10 files changed, 37 insertions(+), 53 deletions(-) diff --git a/.env.example b/.env.example index 991a06ff..b12e9517 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,3 @@ MAIN_VITE_API_URL=API_URL MAIN_VITE_AUTH_URL=AUTH_URL MAIN_VITE_STEAMGRIDDB_API_KEY=YOUR_API_KEY -RENDERER_VITE_INTERCOM_APP_ID=YOUR_APP_ID diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89392011..0f650fc5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,16 +22,6 @@ jobs: with: node-version: 20.18.0 - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} - aws-region: ${{ env.AWS_REGION }} - - - name: Push build to R2 - run: aws s3 sync ./docs s3://${{ vars.BUILDS_BUCKET_NAME }} - - name: Install dependencies run: yarn diff --git a/src/main/events/index.ts b/src/main/events/index.ts index eff62531..932b80e4 100644 --- a/src/main/events/index.ts +++ b/src/main/events/index.ts @@ -1,4 +1,4 @@ -import { appVersion, defaultDownloadsPath, isStaging } from "@main/constants"; +import { appVersion, defaultDownloadsPath } from "@main/constants"; import { ipcMain } from "electron"; import "./catalogue/get-catalogue"; @@ -72,6 +72,5 @@ import "./misc/show-item-in-folder"; ipcMain.handle("ping", () => "pong"); ipcMain.handle("getVersion", () => appVersion); -ipcMain.handle("isStaging", () => isStaging); ipcMain.handle("isPortableVersion", () => isPortableVersion()); ipcMain.handle("getDefaultDownloadsPath", () => defaultDownloadsPath); diff --git a/src/preload/index.ts b/src/preload/index.ts index 0166ba2a..17f4b3e9 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -15,6 +15,7 @@ import type { import type { CatalogueCategory } from "@shared"; import type { AxiosProgressEvent } from "axios"; import { GameAchievement } from "@main/entity"; +import { isStaging } from "@main/constants"; contextBridge.exposeInMainWorld("electron", { /* Torrenting */ @@ -198,7 +199,7 @@ contextBridge.exposeInMainWorld("electron", { ping: () => ipcRenderer.invoke("ping"), getVersion: () => ipcRenderer.invoke("getVersion"), getDefaultDownloadsPath: () => ipcRenderer.invoke("getDefaultDownloadsPath"), - isStaging: () => ipcRenderer.invoke("isStaging"), + isStaging, isPortableVersion: () => ipcRenderer.invoke("isPortableVersion"), openExternal: (src: string) => ipcRenderer.invoke("openExternal", src), openCheckout: () => ipcRenderer.invoke("openCheckout"), diff --git a/src/renderer/index.html b/src/renderer/index.html index bfc3a206..c3ce2e83 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -6,8 +6,12 @@ Hydra +
diff --git a/src/renderer/src/app.tsx b/src/renderer/src/app.tsx index 5a479879..e40d2d27 100644 --- a/src/renderer/src/app.tsx +++ b/src/renderer/src/app.tsx @@ -2,8 +2,6 @@ import { useCallback, useContext, useEffect, useRef } from "react"; import { Sidebar, BottomPanel, Header, Toast } from "@renderer/components"; -import Intercom from "@intercom/messenger-js-sdk"; - import { useAppDispatch, useAppSelector, @@ -36,10 +34,6 @@ export interface AppProps { children: React.ReactNode; } -Intercom({ - app_id: import.meta.env.RENDERER_VITE_INTERCOM_APP_ID, -}); - export function App() { const contentRef = useRef(null); const { updateLibrary, library } = useLibrary(); @@ -68,6 +62,25 @@ export function App() { clearUserDetails, } = useUserDetails(); + useEffect(() => { + if (userDetails) { + const $existingScript = document.getElementById("user-details"); + + const content = `window.userDetails = ${JSON.stringify(userDetails)};`; + + 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); + } + } + }, [userDetails]); + const dispatch = useAppDispatch(); const navigate = useNavigate(); @@ -215,9 +228,7 @@ export function App() { useEffect(() => { new MutationObserver(() => { - const modal = document.body.querySelector( - "[role=dialog]:not([data-intercom-frame='true'])" - ); + const modal = document.body.querySelector("[data-hydra-dialog]"); dispatch(toggleDraggingDisabled(Boolean(modal))); }).observe(document.body, { diff --git a/src/renderer/src/components/modal/modal.tsx b/src/renderer/src/components/modal/modal.tsx index eb2894de..af15feb5 100644 --- a/src/renderer/src/components/modal/modal.tsx +++ b/src/renderer/src/components/modal/modal.tsx @@ -107,6 +107,7 @@ export function Modal({ aria-labelledby={title} aria-describedby={description} ref={modalContentRef} + data-hydra-dialog >
diff --git a/src/renderer/src/components/sidebar/sidebar.tsx b/src/renderer/src/components/sidebar/sidebar.tsx index 787cf66a..f487681c 100644 --- a/src/renderer/src/components/sidebar/sidebar.tsx +++ b/src/renderer/src/components/sidebar/sidebar.tsx @@ -22,8 +22,6 @@ import { SidebarProfile } from "./sidebar-profile"; import { sortBy } from "lodash-es"; import { CommentDiscussionIcon } from "@primer/octicons-react"; -import { show, update } from "@intercom/messenger-js-sdk"; - const SIDEBAR_MIN_WIDTH = 200; const SIDEBAR_INITIAL_WIDTH = 250; const SIDEBAR_MAX_WIDTH = 450; @@ -50,23 +48,7 @@ export function Sidebar() { return sortBy(library, (game) => game.title); }, [library]); - const { userDetails, hasActiveSubscription } = useUserDetails(); - - useEffect(() => { - if (userDetails) { - window.electron.isStaging().then((isStaging) => { - update({ - user_id: userDetails.id + (isStaging ? "-staging" : ""), - name: userDetails.displayName, - Username: userDetails.username, - email: userDetails.email ?? undefined, - Email: userDetails.email, - "Subscription expiration date": userDetails?.subscription?.expiresAt, - "Payment status": userDetails?.subscription?.status, - }); - }); - } - }, [userDetails, hasActiveSubscription]); + const { hasActiveSubscription } = useUserDetails(); const { lastPacket, progress } = useDownload(); @@ -269,7 +251,11 @@ export function Sidebar() {
{hasActiveSubscription && ( - + <> + + {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 41/43] 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 42/43] 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 43/43] 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 (