Skip to content

Commit

Permalink
prune things I don't want
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeAspy committed Sep 15, 2024
1 parent da80b8b commit c1d8582
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 27 deletions.
4 changes: 1 addition & 3 deletions electron.vite.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-check
import { defineConfig } from "electron-vite";

export default defineConfig(() => {
Expand All @@ -10,9 +11,6 @@ export default defineConfig(() => {
entry: "src/preload/preload.mts",
}
}
},
renderer: {

}
}
})
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default tseslint.config(
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname
tsconfigRootDir: "./tsconfig.json"
}
},
rules: {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"electron-builder": "^25.0.5",
"electron-vite": "^2.3.0",
"eslint": "^9.10.0",
"eslint-config-prettier": "^9.1.0",
"prettier": "^3.3.3",
"typescript": "^5.6.2",
"typescript-eslint": "^8.5.0"
Expand Down
92 changes: 75 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/@types/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ export interface Config {
channel: "stable" | "ptb" | "canary";
multiInstance: boolean;
mods: "vencord"[];
autoHideMenuBar: boolean;
tray: boolean;
}
2 changes: 1 addition & 1 deletion src/main/discord/discordWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function createDiscordWindow() {
preload: join(import.meta.dirname, "../preload/preload.mjs"),
nodeIntegration: true
},
autoHideMenuBar: getConfig("autoHideMenuBar")
autoHideMenuBar: true
});

const channel = getConfig("channel");
Expand Down
9 changes: 7 additions & 2 deletions src/main/tray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {app, Menu, nativeImage, Tray, type WebContents} from "electron";
import icon from "../../resources/placeholderTrayIcon.png?asset";

export function startTray(pageData: WebContents) {
// Strange ESLint and TSC fighting here
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
const tray = new Tray(icon as string);
tray.setToolTip("Acorn");
Expand All @@ -17,9 +18,13 @@ export function startTray(pageData: WebContents) {
);
pageData.on("page-favicon-updated", (_, favicons) => {
try {
tray.setImage(nativeImage.createFromDataURL(favicons[0]!));
let favicon = nativeImage.createFromDataURL(favicons[0]!);
if (process.platform === "win32") {
favicon = favicon.resize({height: 32}); // Windows scaling disaster
}
tray.setImage(favicon);
} catch {
return; // NOTE - Discord will send a URL before fully loaded
return; // Discord will send a URL before fully loaded
}
});
}
Empty file removed src/renderer/index.html
Empty file.
Empty file removed src/renderer/index.ts
Empty file.
1 change: 0 additions & 1 deletion src/shared/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ function makeConfig() {
channel: "stable",
multiInstance: false,
mods: ["vencord"],
autoHideMenuBar: true,
tray: true
} as Config;
writeFileSync(configLocation, JSON.stringify(config, null, 2), {encoding: "utf8", flag: "w"});
Expand Down

0 comments on commit c1d8582

Please sign in to comment.