Skip to content

Commit

Permalink
Merge branch 'Legcord:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
CCIGAMES authored Nov 27, 2024
2 parents 7497805 + f2a66c2 commit da85ee0
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
15 changes: 15 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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<void>((resolve) =>
Expand Down Expand Up @@ -148,6 +161,8 @@ if (!app.requestSingleInstanceLock() && getConfig("multiInstance") === false) {
resolve(true);
}),
);
} else {
callback(true);
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/shelter/settings/pages/SettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function SettingsPage() {
<option value="none">{store.i18n["settings-none"]}</option>
</DropdownItem>
<DropdownItem
value={store.settings.trayIcon}
value={store.settings.tray}
onChange={(e) => setConfig("tray", (e.target as HTMLInputElement).value as Settings["tray"], true)}
title={store.i18n["settings-trayIcon"]}
note={store.i18n["settings-trayIcon-desc"]}
Expand Down
3 changes: 3 additions & 0 deletions src/splash/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export async function createSplashWindow(): Promise<void> {
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");
});
Expand Down
1 change: 1 addition & 0 deletions src/splash/preload.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
4 changes: 3 additions & 1 deletion src/splash/splash.html
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/themeManager/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export async function createTManagerWindow(): Promise<void> {
await themeWindow.loadFile(`${import.meta.dirname}/html/manager.html`);
themeWindow.on("close", () => {
instance = 0;
ipcMain.removeHandler("installBDTheme");
});
}
}

0 comments on commit da85ee0

Please sign in to comment.