diff --git a/src/main/constants.ts b/src/main/constants.ts index 01bdd80..dcfc8fc 100644 --- a/src/main/constants.ts +++ b/src/main/constants.ts @@ -5,7 +5,7 @@ */ import { app } from "electron"; -import { existsSync, mkdirSync, readdirSync, renameSync, rmdirSync } from "fs"; +import { existsSync, mkdirSync } from "fs"; import { dirname, join } from "path"; const vesktopDir = dirname(process.execPath); @@ -15,28 +15,11 @@ export const PORTABLE = !process.execPath.toLowerCase().endsWith("electron.exe") && !existsSync(join(vesktopDir, "Uninstall Vesktop.exe")); -const LEGACY_DATA_DIR = join(app.getPath("appData"), "VencordDesktop", "VencordDesktop"); export const DATA_DIR = process.env.VENCORD_USER_DATA_DIR || (PORTABLE ? join(vesktopDir, "Data") : join(app.getPath("userData"))); mkdirSync(DATA_DIR, { recursive: true }); -// TODO: remove eventually -if (existsSync(LEGACY_DATA_DIR)) { - try { - console.warn("Detected legacy settings dir", LEGACY_DATA_DIR + ".", "migrating to", DATA_DIR); - for (const file of readdirSync(LEGACY_DATA_DIR)) { - renameSync(join(LEGACY_DATA_DIR, file), join(DATA_DIR, file)); - } - rmdirSync(LEGACY_DATA_DIR); - renameSync( - join(app.getPath("appData"), "VencordDesktop", "IndexedDB"), - join(DATA_DIR, "sessionData", "IndexedDB") - ); - } catch (e) { - console.error("Migration failed", e); - } -} const SESSION_DATA_DIR = join(DATA_DIR, "sessionData"); app.setPath("sessionData", SESSION_DATA_DIR); diff --git a/src/main/settings.ts b/src/main/settings.ts index 128ea54..ce559fb 100644 --- a/src/main/settings.ts +++ b/src/main/settings.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs"; +import { mkdirSync, readFileSync, writeFileSync } from "fs"; import { dirname, join } from "path"; import type { Settings as TSettings, State as TState } from "shared/settings"; import { SettingsStore } from "shared/utils/SettingsStore"; @@ -35,18 +35,5 @@ function loadSettings(file: string, name: string) { } export const Settings = loadSettings(SETTINGS_FILE, "Vesktop settings"); - export const VencordSettings = loadSettings(VENCORD_SETTINGS_FILE, "Vencord settings"); - -if (Object.hasOwn(Settings.plain, "firstLaunch") && !existsSync(STATE_FILE)) { - console.warn("legacy state in settings.json detected. migrating to state.json"); - const state = {} as TState; - for (const prop of ["firstLaunch", "maximized", "minimized", "steamOSLayoutVersion", "windowBounds"] as const) { - state[prop] = Settings.plain[prop]; - delete Settings.plain[prop]; - } - Settings.markAsChanged(); - writeFileSync(STATE_FILE, JSON.stringify(state, null, 4)); -} - export const State = loadSettings(STATE_FILE, "Vesktop state"); diff --git a/src/renderer/fixes.css b/src/renderer/fixes.css deleted file mode 100644 index 9411321..0000000 --- a/src/renderer/fixes.css +++ /dev/null @@ -1,4 +0,0 @@ -/* Workaround for making things in the draggable area clickable again on macOS */ -.platform-osx [class*=topic_], .platform-osx [class*=notice_] button { - -webkit-app-region: no-drag; -} diff --git a/src/renderer/fixes.ts b/src/renderer/fixes.ts index c9650b5..64b0a4b 100644 --- a/src/renderer/fixes.ts +++ b/src/renderer/fixes.ts @@ -4,8 +4,6 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import "./fixes.css"; - import { localStorage } from "./utils"; // Make clicking Notifications focus the window diff --git a/src/renderer/patches/shared.ts b/src/renderer/patches/shared.ts index 90f18dc..07b77a6 100644 --- a/src/renderer/patches/shared.ts +++ b/src/renderer/patches/shared.ts @@ -17,7 +17,6 @@ export function addPatch

(p: P) { const { patches, ...globals } = p; for (const patch of patches) { - // TODO: Update types Vencord.Plugins.addPatch(patch, "Vesktop", "VesktopPatchGlobals"); }