Skip to content

Commit

Permalink
fetch and linux fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex313031 committed May 16, 2024
1 parent a836802 commit c1049b9
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ export async function checkIfConfigIsBroken(): Promise<void> {

export function setup(): void {
console.log("Setting up temporary ArmCord settings.");
const isLinux = process.platform === "linux";
const defaults: Settings = {
windowStyle: "default",
windowStyle: isLinux ? "native" : "default",
channel: "stable",
armcordCSP: true,
minimizeToTray: true,
Expand Down
2 changes: 2 additions & 0 deletions src/common/dom.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import fetch from "cross-fetch";

export function addStyle(styleString: string): void {
const style = document.createElement("style");
style.textContent = styleString;
Expand Down
5 changes: 1 addition & 4 deletions src/common/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ export function getVersion(): string {
return app.getVersion();
}
export function getDisplayVersion(): string {
if ((app.getVersion() == process.versions.electron) == true) {
return "Dev Build";
}
return app.getVersion();
return getVersion();
}
1 change: 1 addition & 0 deletions src/discord/extensions/mods.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {app, dialog} from "electron";
import extract from "extract-zip";
import path from "path";
import fetch from "cross-fetch";
import {getConfig} from "../../common/config";
import fs from "fs";
import util from "util";
Expand Down
2 changes: 1 addition & 1 deletion src/discord/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async function doAfterDefiningTheWindow(): Promise<void> {
mainWindow.hide(); // please don't flashbang the user
}
if ((await getConfig("windowStyle")) == "transparency" && process.platform === "win32") {
// mainWindow.setBackgroundMaterial("mica");
//mainWindow.setBackgroundMaterial("mica");
if ((await getConfig("startMinimized")) == false) {
mainWindow.show();
}
Expand Down
8 changes: 7 additions & 1 deletion src/setup/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,15 @@
"linuxNotice"
).innerHTML = `Linux may not work well with tray icons. Depending on your system configuration, you may not be able to see the tray icon. Enable at your own risk. Can be changed later.`;
}
let useNativeLinux;
if (window.armcordinternal.getOS == "linux") {
useNativeLinux = "native";
} else {
useNativeLinux = "default";
}
document.getElementById("next-page4").addEventListener("click", () => {
window.armcordinternal.saveSettings({
windowStyle: "default",
windowStyle: useNativeLinux,
channel: options.channel,
armcordCSP: true,
minimizeToTray: true,
Expand Down
1 change: 1 addition & 0 deletions src/themeManager/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {BrowserWindow, app, dialog, ipcMain, shell} from "electron";
import path from "path";
import fs from "fs";
import fetch from "cross-fetch";
import {sleep} from "../common/sleep";
import {createInviteWindow, mainWindow} from "../discord/window";
let themeWindow: BrowserWindow;
Expand Down

0 comments on commit c1049b9

Please sign in to comment.