diff --git a/README.md b/README.md index 085e917c..0962656f 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Not available yet. ### Scoop package -LegCord is also available on the [Extras](https://github.com/ScoopInstaller/Extras) repo +Legcord is also available on the [Extras](https://github.com/ScoopInstaller/Extras) repo ```powershell scoop bucket add extras # Ensure bucket is added first @@ -91,7 +91,7 @@ scoop install legcord ### Homebrew repository -LegCord is also available on the [Homebrew Cask](https://github.com/Homebrew/homebrew-cask) repo +Legcord is also available on the [Homebrew Cask](https://github.com/Homebrew/homebrew-cask) repo ```zsh brew install --cask legcord diff --git a/package.json b/package.json index 3120a1c2..b02d1edf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "legcord", - "version": "1.0.4", + "version": "1.0.5", "description": "Legcord is a custom client designed to enhance your Discord experience while keeping everything lightweight.", "main": "ts-out/main.js", "engines": { diff --git a/src/main.ts b/src/main.ts index edd8a667..cdbfaebe 100644 --- a/src/main.ts +++ b/src/main.ts @@ -98,6 +98,8 @@ if (!app.requestSingleInstanceLock() && getConfig("multiInstance") === false) { await fetchMods(); void import("./discord/extensions/plugin.js"); // load chrome extensions console.log(`[Config Manager] Current config: ${readFileSync(getConfigLocation(), "utf-8")}`); + + // OLD CONFIGS MIGRATION if (getConfig("hardwareAcceleration") === false) { app.disableHardwareAcceleration(); } else if (getConfig("hardwareAcceleration") === undefined) { @@ -107,9 +109,20 @@ if (!app.requestSingleInstanceLock() && getConfig("multiInstance") === false) { if (getConfig("keybinds") === undefined) setConfig("keybinds", []); if (getConfig("transparency") === undefined) setConfig("transparency", "none"); if (getConfig("windowStyle") === "transparent") setConfig("windowStyle", "default"); + if (typeof getConfig("tray") === "boolean") { + //@ts-expect-error + if (getConfig("tray") === true) { + setConfig("tray", "dynamic"); + //@ts-expect-error old types + } else if (getConfig("tray") === false) { + setConfig("tray", "disabled"); + } + } + if (getConfig("smoothScroll") === false) app.commandLine.appendSwitch("disable-smooth-scrolling"); if (getConfig("autoScroll")) app.commandLine.appendSwitch("enable-blink-features", "MiddleClickAutoscroll"); if (getConfig("disableHttpCache")) app.commandLine.appendSwitch("disable-http-cache"); + void app.whenReady().then(async () => { // Patch for linux bug to ensure things are loaded before window creation (fixes transparency on some linux systems) await new Promise((resolve) => @@ -148,6 +161,8 @@ if (!app.requestSingleInstanceLock() && getConfig("multiInstance") === false) { resolve(true); }), ); + } else { + callback(true); } break; } diff --git a/src/shelter/settings/pages/SettingsPage.tsx b/src/shelter/settings/pages/SettingsPage.tsx index 800665db..f9e97784 100644 --- a/src/shelter/settings/pages/SettingsPage.tsx +++ b/src/shelter/settings/pages/SettingsPage.tsx @@ -81,7 +81,7 @@ export function SettingsPage() { setConfig("tray", (e.target as HTMLInputElement).value as Settings["tray"], true)} title={store.i18n["settings-trayIcon"]} note={store.i18n["settings-trayIcon-desc"]} diff --git a/src/splash/main.ts b/src/splash/main.ts index b9e6fcc5..5bd1e579 100644 --- a/src/splash/main.ts +++ b/src/splash/main.ts @@ -23,6 +23,9 @@ export async function createSplashWindow(): Promise { ipcMain.on("splash-isDev", (event) => { event.returnValue = isDev; }); + ipcMain.on("splash-isMicrosoftStore", (event) => { + event.returnValue = process.windowsStore; + }); ipcMain.on("splash-clientmod", (event) => { event.returnValue = getConfig("mods"); }); diff --git a/src/splash/preload.mts b/src/splash/preload.mts index bb90249e..58cd0c3a 100644 --- a/src/splash/preload.mts +++ b/src/splash/preload.mts @@ -4,6 +4,7 @@ contextBridge.exposeInMainWorld("internal", { restart: () => ipcRenderer.send("restart"), version: ipcRenderer.sendSync("get-app-version", "app-version") as string, isDev: ipcRenderer.sendSync("splash-isDev") as string, + isMicrosoftStore: ipcRenderer.sendSync("splash-isMicrosoftStore") as string, mods: ipcRenderer.sendSync("splash-clientmod") as string, getLang: (toGet: string) => ipcRenderer.invoke("getLang", toGet).then((result: string) => { diff --git a/src/splash/splash.html b/src/splash/splash.html index dabadb5e..0d2af445 100644 --- a/src/splash/splash.html +++ b/src/splash/splash.html @@ -36,7 +36,9 @@ } else { text.innerHTML = await internal.getLang("loading_screen_start"); if (internal.isDev) { - console.log("Running a development build of Legcord. Skipping updater."); + console.log("Development build detected. Skipping updater."); + } else if (internal.isMicrosoftStore) { + console.log("Microsoft Store build detected. Skipping updater.") } else { const response = await fetch("https://legcord.app/latest.json"); const data = await response.json(); diff --git a/src/themeManager/main.ts b/src/themeManager/main.ts index af076cdf..02e90926 100644 --- a/src/themeManager/main.ts +++ b/src/themeManager/main.ts @@ -132,6 +132,7 @@ export async function createTManagerWindow(): Promise { await themeWindow.loadFile(`${import.meta.dirname}/html/manager.html`); themeWindow.on("close", () => { instance = 0; + ipcMain.removeHandler("installBDTheme"); }); } }