From 352c359f172ec8908586795caf42aef282ead3a3 Mon Sep 17 00:00:00 2001 From: Official-Husko <27901510+Official-Husko@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:41:41 +0200 Subject: [PATCH] i bet shit will burn --- .github/workflows/all_os.yml | 83 +--------- apps/desktop/packages/main/index.ts | 9 - .../components/AdTrackingSettingsSlider.tsx | 68 -------- .../packages/mainWindow/src/global.d.ts | 1 - .../src/managers/ModalsManager/index.tsx | 12 -- .../ModalsManager/modals/PrivacyStatement.tsx | 29 ---- .../modals/TermsAndConditions.tsx | 29 ---- .../ModalsManager/modals/WhyAreAdsNeeded.tsx | 65 -------- .../src/pages/Login/TermsAndConditions.tsx | 154 ------------------ .../mainWindow/src/pages/Login/index.tsx | 7 +- .../mainWindow/src/pages/Settings/Privacy.tsx | 66 -------- .../packages/mainWindow/src/route/index.tsx | 4 - .../mainWindow/src/route/privateRoute.tsx | 3 +- apps/desktop/packages/preload/index.ts | 1 - apps/desktop/packages/preload/overwolf.ts | 5 - 15 files changed, 6 insertions(+), 530 deletions(-) delete mode 100644 apps/desktop/packages/mainWindow/src/components/AdTrackingSettingsSlider.tsx delete mode 100644 apps/desktop/packages/mainWindow/src/managers/ModalsManager/modals/PrivacyStatement.tsx delete mode 100644 apps/desktop/packages/mainWindow/src/managers/ModalsManager/modals/TermsAndConditions.tsx delete mode 100644 apps/desktop/packages/mainWindow/src/managers/ModalsManager/modals/WhyAreAdsNeeded.tsx delete mode 100644 apps/desktop/packages/mainWindow/src/pages/Login/TermsAndConditions.tsx delete mode 100644 apps/desktop/packages/mainWindow/src/pages/Settings/Privacy.tsx delete mode 100644 apps/desktop/packages/preload/overwolf.ts diff --git a/.github/workflows/all_os.yml b/.github/workflows/all_os.yml index 3e19c4bfc..6b914b732 100644 --- a/.github/workflows/all_os.yml +++ b/.github/workflows/all_os.yml @@ -1,17 +1,16 @@ -name: Build and Deploy GDLauncher +name: Test if shit breaks on: push: branches: - - patched - + - remove-tracking env: CARGO_TERM_COLOR: always jobs: build_and_deploy_linux: - name: Build and Deploy (Linux) + name: Linux builds go brrrrrr runs-on: ubuntu-latest timeout-minutes: 80 @@ -32,78 +31,4 @@ jobs: run: pnpm codegen - name: Build Application for Linux - run: pnpm build:linux-x64 - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: linux - path: ./apps/desktop/release/linux-unpacked/resources/app.asar - - build_and_deploy_macos: - name: Build and Deploy (macOS) - runs-on: macos-latest - timeout-minutes: 80 - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install pnpm - run: npm install -g pnpm - - - name: Install project dependencies - run: pnpm install - - - name: Setup Rust toolchain and targets - uses: dtolnay/rust-toolchain@master - with: - toolchain: 1.75.0 - targets: aarch64-apple-darwin, x86_64-apple-darwin - components: clippy, rustfmt - - - name: Apply the Patch - run: git apply < adsbegone-gdlauncher-carbon.patch - - - name: Generate Prisma Code and RSPC Bindings - run: pnpm codegen - - - name: Build Application for macOS - run: pnpm build:mac-universal - - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: mac - path: ./apps/desktop/release/mac-universal/GDLauncher.app/Contents/Resources/app.asar - - build_and_deploy_windows: - name: Build and Deploy (Windows) - runs-on: windows-latest - timeout-minutes: 80 - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install pnpm - run: npm install -g pnpm - - - name: Install project dependencies - run: pnpm install - - - name: Apply the Patch - run: git apply adsbegone-gdlauncher-carbon.patch - - - name: Generate Prisma Code and RSPC Bindings - run: pnpm codegen - - - name: Build Application for Windows - run: pnpm build:win-x64 - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: windows - path: ./apps/desktop/release/win-unpacked/resources/app.asar - + run: pnpm build:linux-x64 \ No newline at end of file diff --git a/apps/desktop/packages/main/index.ts b/apps/desktop/packages/main/index.ts index f360ad840..2e0cda818 100644 --- a/apps/desktop/packages/main/index.ts +++ b/apps/desktop/packages/main/index.ts @@ -405,10 +405,6 @@ const loadCoreModule: CoreModule = () => const coreModule = loadCoreModule(); -if ((app as any).overwolf) { - (app as any).overwolf.disableAnonymousAnalytics(); -} - // Set application name for Windows 10+ notifications if (process.platform === "win32") app.setAppUserModelId(app.getName()); @@ -600,11 +596,6 @@ ipcMain.handle("openFolder", async (_, path) => { shell.showItemInFolder(path); }); -ipcMain.handle("openCMPWindow", async () => { - // @ts-ignore - app.overwolf.openCMPWindow(); -}); - ipcMain.handle("closeWindow", async () => { win?.close(); win?.destroy(); diff --git a/apps/desktop/packages/mainWindow/src/components/AdTrackingSettingsSlider.tsx b/apps/desktop/packages/mainWindow/src/components/AdTrackingSettingsSlider.tsx deleted file mode 100644 index 85807b80d..000000000 --- a/apps/desktop/packages/mainWindow/src/components/AdTrackingSettingsSlider.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { useTransContext } from "@gd/i18n"; -import { Slider } from "@gd/ui"; - -type Props = { - metricLevel: number | null | undefined; - onChange: (_metricsLevel: number) => void; -}; - -const AdTrackingSettingsSlider = (props: Props) => { - const [t] = useTransContext(); - - const mapValueToMetricLevel = (value: number) => { - switch (value) { - case 0: - return 0; - case 250: - return 1; - case 600: - return 2; - case 1000: - return 3; - default: - return 1; - } - }; - - const mapMetricLevelToValue = (value: number | undefined | null) => { - switch (value) { - case 0: - return 0; - case 1: - return 250; - case 2: - return 600; - case 3: - return 1000; - default: - return 1; - } - }; - - return ( -
-
- { - props.onChange(mapValueToMetricLevel(val)); - }} - /> -
-
- ); -}; - -export default AdTrackingSettingsSlider; diff --git a/apps/desktop/packages/mainWindow/src/global.d.ts b/apps/desktop/packages/mainWindow/src/global.d.ts index 9f348d8aa..367ec7fce 100644 --- a/apps/desktop/packages/mainWindow/src/global.d.ts +++ b/apps/desktop/packages/mainWindow/src/global.d.ts @@ -42,7 +42,6 @@ declare global { openExternalLink: (link: string) => void; openFolder: (path: string) => void; copyToClipboard: (text: string) => void; - openCMPWindow: () => void; getCoreModule: () => Promise< | { type: "success"; diff --git a/apps/desktop/packages/mainWindow/src/managers/ModalsManager/index.tsx b/apps/desktop/packages/mainWindow/src/managers/ModalsManager/index.tsx index f074f98d9..46328c888 100644 --- a/apps/desktop/packages/mainWindow/src/managers/ModalsManager/index.tsx +++ b/apps/desktop/packages/mainWindow/src/managers/ModalsManager/index.tsx @@ -29,14 +29,6 @@ type Hash = { }; const defaultModals = { - privacyStatement: { - component: lazy(() => import("./modals/PrivacyStatement")), - title: "Privacy Statement" - }, - termsAndConditions: { - component: lazy(() => import("./modals/TermsAndConditions")), - title: "Terms and Conditions" - }, addManagedJava: { component: lazy(() => import("./modals/Java/AddManagedJava")), title: "Add java version" @@ -93,10 +85,6 @@ const defaultModals = { component: lazy(() => import("./modals/OnBoarding")), noHeader: true }, - whyAreAdsNeeded: { - component: lazy(() => import("./modals/WhyAreAdsNeeded")), - title: "Why are ads needed?" - }, modsUpdater: { component: lazy(() => import("./modals/ModsUpdater")), title: "Mods Updater" diff --git a/apps/desktop/packages/mainWindow/src/managers/ModalsManager/modals/PrivacyStatement.tsx b/apps/desktop/packages/mainWindow/src/managers/ModalsManager/modals/PrivacyStatement.tsx deleted file mode 100644 index 266e98f46..000000000 --- a/apps/desktop/packages/mainWindow/src/managers/ModalsManager/modals/PrivacyStatement.tsx +++ /dev/null @@ -1,29 +0,0 @@ -/* eslint-disable solid/no-innerhtml */ -import { rspc } from "@/utils/rspcClient"; -import sanitizeHtml from "sanitize-html"; -import { ModalProps } from ".."; -import ModalLayout from "../ModalLayout"; -import { Suspense } from "solid-js"; - -const PrivacyStatement = (props: ModalProps) => { - const body = rspc.createQuery(() => ({ - queryKey: ["settings.getPrivacyStatementBody"] - })); - - const sanitizedHtml = () => { - if (!body.data) return undefined; - return sanitizeHtml(body.data); - }; - - return ( - - -
-
-
- - - ); -}; - -export default PrivacyStatement; diff --git a/apps/desktop/packages/mainWindow/src/managers/ModalsManager/modals/TermsAndConditions.tsx b/apps/desktop/packages/mainWindow/src/managers/ModalsManager/modals/TermsAndConditions.tsx deleted file mode 100644 index 222d2a068..000000000 --- a/apps/desktop/packages/mainWindow/src/managers/ModalsManager/modals/TermsAndConditions.tsx +++ /dev/null @@ -1,29 +0,0 @@ -/* eslint-disable solid/no-innerhtml */ -import { rspc } from "@/utils/rspcClient"; -import sanitizeHtml from "sanitize-html"; -import { ModalProps } from ".."; -import ModalLayout from "../ModalLayout"; -import { Suspense } from "solid-js"; - -const TermsAndConditions = (props: ModalProps) => { - const body = rspc.createQuery(() => ({ - queryKey: ["settings.getTermsOfServiceBody"] - })); - - const sanitizedHtml = () => { - if (!body.data) return undefined; - return sanitizeHtml(body.data); - }; - - return ( - - -
-
-
- - - ); -}; - -export default TermsAndConditions; diff --git a/apps/desktop/packages/mainWindow/src/managers/ModalsManager/modals/WhyAreAdsNeeded.tsx b/apps/desktop/packages/mainWindow/src/managers/ModalsManager/modals/WhyAreAdsNeeded.tsx deleted file mode 100644 index 11d249b2b..000000000 --- a/apps/desktop/packages/mainWindow/src/managers/ModalsManager/modals/WhyAreAdsNeeded.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { ModalProps } from ".."; -import ModalLayout from "../ModalLayout"; -import { Trans } from "@gd/i18n"; - -const WhyAreAdsNeeded = (props: ModalProps) => { - return ( - -
-

- -

-

- -

-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
-

- -

-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
-

- -

-

- -

-

- -

-

- -

-

- -

-
-
- ); -}; - -export default WhyAreAdsNeeded; diff --git a/apps/desktop/packages/mainWindow/src/pages/Login/TermsAndConditions.tsx b/apps/desktop/packages/mainWindow/src/pages/Login/TermsAndConditions.tsx deleted file mode 100644 index 1686765cc..000000000 --- a/apps/desktop/packages/mainWindow/src/pages/Login/TermsAndConditions.tsx +++ /dev/null @@ -1,154 +0,0 @@ -import { Show, createSignal } from "solid-js"; -import { Trans } from "@gd/i18n"; -import { Button, Checkbox, createNotification } from "@gd/ui"; -import { useModal } from "@/managers/ModalsManager"; -import { rspc } from "@/utils/rspcClient"; - -type Props = { - nextStep: () => void; -}; - -const TermsAndConditions = (props: Props) => { - const [acceptedTOS, setAcceptedTOS] = createSignal(false); - const [acceptedMetrics, setAcceptedMetrics] = createSignal(false); - const [loadingButton, setLoadingButton] = createSignal(false); - const modalsContext = useModal(); - const addNotification = createNotification(); - - const activeUuid = rspc.createQuery(() => ({ - queryKey: ["account.getActiveUuid"] - })); - const settingsMutation = rspc.createMutation(() => ({ - mutationKey: ["settings.setSettings"] - })); - - return ( -
-
-
-
-

- - - {" - "} - - -

-
-
-
- -
- -
-
-
- -
-
- -
-
- -
-
- -
-
-
-
-
-
-
-
-
- { - setAcceptedMetrics((prev) => !prev); - }} - /> -

- -

-
-
- { - setAcceptedTOS((prev) => !prev); - }} - /> -

- - I have read and accept - { - modalsContext?.openModal({ - name: "termsAndConditions" - }); - }} - > - Terms - - and - { - modalsContext?.openModal({ - name: "privacyStatement" - }); - }} - > - Privacy Policy - - -

-
-
-
-
{ - window?.openCMPWindow(); - }} - > - -
- -
-
-
-
- ); -}; - -export default TermsAndConditions; diff --git a/apps/desktop/packages/mainWindow/src/pages/Login/index.tsx b/apps/desktop/packages/mainWindow/src/pages/Login/index.tsx index 5b92f1645..0aaa34214 100644 --- a/apps/desktop/packages/mainWindow/src/pages/Login/index.tsx +++ b/apps/desktop/packages/mainWindow/src/pages/Login/index.tsx @@ -14,7 +14,6 @@ import fetchData from "./auth.login.data"; import { Navigate, useRouteData } from "@solidjs/router"; import { Trans, supportedLanguages, useTransContext } from "@gd/i18n"; import { rspc } from "@/utils/rspcClient"; -import TermsAndConditions from "./TermsAndConditions"; import Logo from "/assets/images/gdlauncher_vertical_logo.svg"; import BackgroundVideo from "/assets/images/login_background.webm"; import { handleStatus } from "@/utils/login"; @@ -38,7 +37,6 @@ export default function Login() { const isAlreadyAuthenticated = () => routeData?.activeUuid?.data && routeData.accounts.data?.length! > 0 && - routeData.settings.data?.termsAndPrivacyAccepted && Boolean(routeData.settings.data?.metricsEnabledLastUpdate); const accountEnrollFinalizeMutation = rspc.createMutation(() => ({ @@ -80,7 +78,7 @@ export default function Login() { }); createEffect(() => { - if (routeData.settings.data?.termsAndPrivacyAccepted) setStep(1); + setStep(1); }); return ( @@ -167,9 +165,6 @@ export default function Login() {
- - - diff --git a/apps/desktop/packages/mainWindow/src/pages/Settings/Privacy.tsx b/apps/desktop/packages/mainWindow/src/pages/Settings/Privacy.tsx deleted file mode 100644 index d464d7201..000000000 --- a/apps/desktop/packages/mainWindow/src/pages/Settings/Privacy.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import { Button, Switch } from "@gd/ui"; -import { Trans } from "@gd/i18n"; -import PageTitle from "./components/PageTitle"; -import RowsContainer from "./components/RowsContainer"; -import Row from "./components/Row"; -import Title from "./components/Title"; -import RightHandSide from "./components/RightHandSide"; -import { rspc } from "@/utils/rspcClient"; - -const Privacy = () => { - const settings = rspc.createQuery(() => ({ - queryKey: ["settings.getSettings"] - })); - - const settingsMutation = rspc.createMutation(() => ({ - mutationKey: ["settings.setSettings"] - })); - - return ( - <> - - - - - - } - > - <Trans key="settings:ads_personalization_title" /> - - - - - - - }> - <Trans key="settings:enable_metrics_title" /> - - - { - settingsMutation.mutate({ - metricsEnabled: { - Set: e.currentTarget.checked - } - }); - }} - /> - - - - - ); -}; - -export default Privacy; diff --git a/apps/desktop/packages/mainWindow/src/route/index.tsx b/apps/desktop/packages/mainWindow/src/route/index.tsx index fad9e633c..b658bdd49 100644 --- a/apps/desktop/packages/mainWindow/src/route/index.tsx +++ b/apps/desktop/packages/mainWindow/src/route/index.tsx @@ -185,10 +185,6 @@ export const routes: RouteDefinition[] = [ path: "/custom-commands", component: lazy(() => import("@/pages/Settings/CustomCommands")) }, - { - path: "/privacy", - component: lazy(() => import("@/pages/Settings/Privacy")) - }, { path: "/runtime-path", component: lazy(() => import("@/pages/Settings/RuntimePath")) diff --git a/apps/desktop/packages/mainWindow/src/route/privateRoute.tsx b/apps/desktop/packages/mainWindow/src/route/privateRoute.tsx index 74c7c3b36..bcdc5e24b 100644 --- a/apps/desktop/packages/mainWindow/src/route/privateRoute.tsx +++ b/apps/desktop/packages/mainWindow/src/route/privateRoute.tsx @@ -14,8 +14,7 @@ const PrivateRoute = (props: Props) => { const isAlreadyAuthenticated = () => routeData?.activeUuid?.data && routeData.accounts.data?.length! > 0 && - !routeData.status.data && - routeData.settings.data?.termsAndPrivacyAccepted; + !routeData.status.data; createEffect(() => { if (!isAlreadyAuthenticated()) navigate("/"); diff --git a/apps/desktop/packages/preload/index.ts b/apps/desktop/packages/preload/index.ts index 7133b7795..045a39079 100644 --- a/apps/desktop/packages/preload/index.ts +++ b/apps/desktop/packages/preload/index.ts @@ -6,7 +6,6 @@ import "./minimumBounds"; import "./autoupdate"; import "./openExternal"; import "./os"; -import "./overwolf"; import "./runtimePath"; import "./relaunch"; diff --git a/apps/desktop/packages/preload/overwolf.ts b/apps/desktop/packages/preload/overwolf.ts deleted file mode 100644 index 11aeea693..000000000 --- a/apps/desktop/packages/preload/overwolf.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { contextBridge, ipcRenderer } from "electron"; - -contextBridge.exposeInMainWorld("openCMPWindow", () => { - return ipcRenderer.invoke("openCMPWindow"); -});