armcord/src/tray.ts

132 lines
4.9 KiB
TypeScript
Raw Normal View History

Updates and Linting (#578) * Updates and Linting * fix lint task * [ImgBot] Optimize images *Total -- 404.98kb -> 304.38kb (24.84%) /assets/screenshot-1920x1080.png -- 205.00kb -> 123.21kb (39.9%) /build/appx/Square150x150Logo.png -- 9.63kb -> 7.71kb (20%) /assets/ac_icon.png -- 40.15kb -> 34.98kb (12.88%) /assets/StoreLogo.png -- 40.15kb -> 34.98kb (12.88%) /assets/Square150x150Logo.png -- 7.24kb -> 6.53kb (9.83%) /assets/ac_icon_transparent.png -- 45.54kb -> 42.00kb (7.76%) /assets/ac_plug_colored.png -- 17.98kb -> 16.72kb (7%) /assets/ac_black_plug.png -- 8.49kb -> 8.06kb (5.06%) /assets/ac_black_plug_hollow.png -- 10.30kb -> 9.95kb (3.4%) /build/appx/Square44x44Logo.png -- 1.69kb -> 1.64kb (2.89%) /assets/Square44x44Logo.png -- 1.90kb -> 1.85kb (2.83%) /assets/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /build/appx/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /assets/ac_white_plug.png -- 8.49kb -> 8.42kb (0.83%) Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> * Asyncification!!! Check `REVIEW` comments * More async for `src/discord` * update packages to latest minor version * Void some promises * Add some types - 93 problems left! * make DeepScan Happy * DeepScan part 2 * I am the Constant * preload must be `.mts` * Migrate electron context menu official package * fix bad preload on setup window * fix minor import oversights * fix modloader * Stop main window from continuing during setup * update packages, slow dependabot * Remove paste override, it seems to work without now * IPC typing * Package updates & a few more typings * fix linting errors in screenshare * use pnpm in actions * fix dev releaser? * update node build, fix dev one more time * release action is broke * Fix Release * update actions * actions are so finicky * remove delete-tag-and-release * add github token env * Hopefully this fixes the release workflow * [debug] * this should actually fix it * Fix typo in dev action * put everything in a dir and then get it * use a different releaser * correct release file location * action places it in a folder named x.zip, recurse into that and grab the actual files * Cleanup actions a bit * release is dependent on mac build * remove mac build * split linux arm and x86 * rely on linux arm * remove deprecated action * attempt to fix weird recursive zip * fix env * use pnpm in actions fix dev releaser? update node build, fix dev one more time release action is broke Fix Release update actions actions are so finicky remove delete-tag-and-release add github token env Hopefully this fixes the release workflow [debug] this should actually fix it Fix typo in dev action put everything in a dir and then get it use a different releaser correct release file location action places it in a folder named x.zip, recurse into that and grab the actual files Cleanup actions a bit release is dependent on mac build remove mac build split linux arm and x86 rely on linux arm remove deprecated action attempt to fix weird recursive zip fix env * don't globally install pnpm packages (I don't think the cache checks global) * Type the armcord window * Finalize typings * fix deepscan issues * fix screenshare preload * fix app quitting --------- Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: smartfrigde <37928912+smartfrigde@users.noreply.github.com>
2024-06-14 12:57:34 +00:00
import fs from "fs";
2023-06-10 21:04:27 +00:00
import {Menu, MessageBoxOptions, Tray, app, dialog, nativeImage} from "electron";
import {createInviteWindow, mainWindows} from "./discord/window.js";
Updates and Linting (#578) * Updates and Linting * fix lint task * [ImgBot] Optimize images *Total -- 404.98kb -> 304.38kb (24.84%) /assets/screenshot-1920x1080.png -- 205.00kb -> 123.21kb (39.9%) /build/appx/Square150x150Logo.png -- 9.63kb -> 7.71kb (20%) /assets/ac_icon.png -- 40.15kb -> 34.98kb (12.88%) /assets/StoreLogo.png -- 40.15kb -> 34.98kb (12.88%) /assets/Square150x150Logo.png -- 7.24kb -> 6.53kb (9.83%) /assets/ac_icon_transparent.png -- 45.54kb -> 42.00kb (7.76%) /assets/ac_plug_colored.png -- 17.98kb -> 16.72kb (7%) /assets/ac_black_plug.png -- 8.49kb -> 8.06kb (5.06%) /assets/ac_black_plug_hollow.png -- 10.30kb -> 9.95kb (3.4%) /build/appx/Square44x44Logo.png -- 1.69kb -> 1.64kb (2.89%) /assets/Square44x44Logo.png -- 1.90kb -> 1.85kb (2.83%) /assets/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /build/appx/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /assets/ac_white_plug.png -- 8.49kb -> 8.42kb (0.83%) Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> * Asyncification!!! Check `REVIEW` comments * More async for `src/discord` * update packages to latest minor version * Void some promises * Add some types - 93 problems left! * make DeepScan Happy * DeepScan part 2 * I am the Constant * preload must be `.mts` * Migrate electron context menu official package * fix bad preload on setup window * fix minor import oversights * fix modloader * Stop main window from continuing during setup * update packages, slow dependabot * Remove paste override, it seems to work without now * IPC typing * Package updates & a few more typings * fix linting errors in screenshare * use pnpm in actions * fix dev releaser? * update node build, fix dev one more time * release action is broke * Fix Release * update actions * actions are so finicky * remove delete-tag-and-release * add github token env * Hopefully this fixes the release workflow * [debug] * this should actually fix it * Fix typo in dev action * put everything in a dir and then get it * use a different releaser * correct release file location * action places it in a folder named x.zip, recurse into that and grab the actual files * Cleanup actions a bit * release is dependent on mac build * remove mac build * split linux arm and x86 * rely on linux arm * remove deprecated action * attempt to fix weird recursive zip * fix env * use pnpm in actions fix dev releaser? update node build, fix dev one more time release action is broke Fix Release update actions actions are so finicky remove delete-tag-and-release add github token env Hopefully this fixes the release workflow [debug] this should actually fix it Fix typo in dev action put everything in a dir and then get it use a different releaser correct release file location action places it in a folder named x.zip, recurse into that and grab the actual files Cleanup actions a bit release is dependent on mac build remove mac build split linux arm and x86 rely on linux arm remove deprecated action attempt to fix weird recursive zip fix env * don't globally install pnpm packages (I don't think the cache checks global) * Type the armcord window * Finalize typings * fix deepscan issues * fix screenshare preload * fix app quitting --------- Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: smartfrigde <37928912+smartfrigde@users.noreply.github.com>
2024-06-14 12:57:34 +00:00
import path from "path";
import {createSettingsWindow} from "./settings/main.js";
import {getConfig, getConfigLocation, setConfig} from "./common/config.js";
import {getDisplayVersion} from "./common/version.js";
Updates and Linting (#578) * Updates and Linting * fix lint task * [ImgBot] Optimize images *Total -- 404.98kb -> 304.38kb (24.84%) /assets/screenshot-1920x1080.png -- 205.00kb -> 123.21kb (39.9%) /build/appx/Square150x150Logo.png -- 9.63kb -> 7.71kb (20%) /assets/ac_icon.png -- 40.15kb -> 34.98kb (12.88%) /assets/StoreLogo.png -- 40.15kb -> 34.98kb (12.88%) /assets/Square150x150Logo.png -- 7.24kb -> 6.53kb (9.83%) /assets/ac_icon_transparent.png -- 45.54kb -> 42.00kb (7.76%) /assets/ac_plug_colored.png -- 17.98kb -> 16.72kb (7%) /assets/ac_black_plug.png -- 8.49kb -> 8.06kb (5.06%) /assets/ac_black_plug_hollow.png -- 10.30kb -> 9.95kb (3.4%) /build/appx/Square44x44Logo.png -- 1.69kb -> 1.64kb (2.89%) /assets/Square44x44Logo.png -- 1.90kb -> 1.85kb (2.83%) /assets/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /build/appx/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /assets/ac_white_plug.png -- 8.49kb -> 8.42kb (0.83%) Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> * Asyncification!!! Check `REVIEW` comments * More async for `src/discord` * update packages to latest minor version * Void some promises * Add some types - 93 problems left! * make DeepScan Happy * DeepScan part 2 * I am the Constant * preload must be `.mts` * Migrate electron context menu official package * fix bad preload on setup window * fix minor import oversights * fix modloader * Stop main window from continuing during setup * update packages, slow dependabot * Remove paste override, it seems to work without now * IPC typing * Package updates & a few more typings * fix linting errors in screenshare * use pnpm in actions * fix dev releaser? * update node build, fix dev one more time * release action is broke * Fix Release * update actions * actions are so finicky * remove delete-tag-and-release * add github token env * Hopefully this fixes the release workflow * [debug] * this should actually fix it * Fix typo in dev action * put everything in a dir and then get it * use a different releaser * correct release file location * action places it in a folder named x.zip, recurse into that and grab the actual files * Cleanup actions a bit * release is dependent on mac build * remove mac build * split linux arm and x86 * rely on linux arm * remove deprecated action * attempt to fix weird recursive zip * fix env * use pnpm in actions fix dev releaser? update node build, fix dev one more time release action is broke Fix Release update actions actions are so finicky remove delete-tag-and-release add github token env Hopefully this fixes the release workflow [debug] this should actually fix it Fix typo in dev action put everything in a dir and then get it use a different releaser correct release file location action places it in a folder named x.zip, recurse into that and grab the actual files Cleanup actions a bit release is dependent on mac build remove mac build split linux arm and x86 rely on linux arm remove deprecated action attempt to fix weird recursive zip fix env * don't globally install pnpm packages (I don't think the cache checks global) * Type the armcord window * Finalize typings * fix deepscan issues * fix screenshare preload * fix app quitting --------- Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: smartfrigde <37928912+smartfrigde@users.noreply.github.com>
2024-06-14 12:57:34 +00:00
export let tray: Tray;
2024-06-15 09:41:35 +00:00
export let isQuitting = false;
2023-06-10 18:06:00 +00:00
let trayIcon = "ac_plug_colored";
Updates and Linting (#578) * Updates and Linting * fix lint task * [ImgBot] Optimize images *Total -- 404.98kb -> 304.38kb (24.84%) /assets/screenshot-1920x1080.png -- 205.00kb -> 123.21kb (39.9%) /build/appx/Square150x150Logo.png -- 9.63kb -> 7.71kb (20%) /assets/ac_icon.png -- 40.15kb -> 34.98kb (12.88%) /assets/StoreLogo.png -- 40.15kb -> 34.98kb (12.88%) /assets/Square150x150Logo.png -- 7.24kb -> 6.53kb (9.83%) /assets/ac_icon_transparent.png -- 45.54kb -> 42.00kb (7.76%) /assets/ac_plug_colored.png -- 17.98kb -> 16.72kb (7%) /assets/ac_black_plug.png -- 8.49kb -> 8.06kb (5.06%) /assets/ac_black_plug_hollow.png -- 10.30kb -> 9.95kb (3.4%) /build/appx/Square44x44Logo.png -- 1.69kb -> 1.64kb (2.89%) /assets/Square44x44Logo.png -- 1.90kb -> 1.85kb (2.83%) /assets/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /build/appx/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /assets/ac_white_plug.png -- 8.49kb -> 8.42kb (0.83%) Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> * Asyncification!!! Check `REVIEW` comments * More async for `src/discord` * update packages to latest minor version * Void some promises * Add some types - 93 problems left! * make DeepScan Happy * DeepScan part 2 * I am the Constant * preload must be `.mts` * Migrate electron context menu official package * fix bad preload on setup window * fix minor import oversights * fix modloader * Stop main window from continuing during setup * update packages, slow dependabot * Remove paste override, it seems to work without now * IPC typing * Package updates & a few more typings * fix linting errors in screenshare * use pnpm in actions * fix dev releaser? * update node build, fix dev one more time * release action is broke * Fix Release * update actions * actions are so finicky * remove delete-tag-and-release * add github token env * Hopefully this fixes the release workflow * [debug] * this should actually fix it * Fix typo in dev action * put everything in a dir and then get it * use a different releaser * correct release file location * action places it in a folder named x.zip, recurse into that and grab the actual files * Cleanup actions a bit * release is dependent on mac build * remove mac build * split linux arm and x86 * rely on linux arm * remove deprecated action * attempt to fix weird recursive zip * fix env * use pnpm in actions fix dev releaser? update node build, fix dev one more time release action is broke Fix Release update actions actions are so finicky remove delete-tag-and-release add github token env Hopefully this fixes the release workflow [debug] this should actually fix it Fix typo in dev action put everything in a dir and then get it use a different releaser correct release file location action places it in a folder named x.zip, recurse into that and grab the actual files Cleanup actions a bit release is dependent on mac build remove mac build split linux arm and x86 rely on linux arm remove deprecated action attempt to fix weird recursive zip fix env * don't globally install pnpm packages (I don't think the cache checks global) * Type the armcord window * Finalize typings * fix deepscan issues * fix screenshare preload * fix app quitting --------- Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: smartfrigde <37928912+smartfrigde@users.noreply.github.com>
2024-06-14 12:57:34 +00:00
void app.whenReady().then(async () => {
// REVIEW - app will hang at startup if line above is awaited.
const finishedSetup = getConfig("doneSetup");
if (getConfig("trayIcon") != "default") {
trayIcon = getConfig("trayIcon");
2023-06-10 18:06:00 +00:00
}
2024-05-15 18:14:18 +00:00
let trayPath = nativeImage.createFromPath(path.join(import.meta.dirname, "../", `/assets/${trayIcon}.png`));
Updates and Linting (#578) * Updates and Linting * fix lint task * [ImgBot] Optimize images *Total -- 404.98kb -> 304.38kb (24.84%) /assets/screenshot-1920x1080.png -- 205.00kb -> 123.21kb (39.9%) /build/appx/Square150x150Logo.png -- 9.63kb -> 7.71kb (20%) /assets/ac_icon.png -- 40.15kb -> 34.98kb (12.88%) /assets/StoreLogo.png -- 40.15kb -> 34.98kb (12.88%) /assets/Square150x150Logo.png -- 7.24kb -> 6.53kb (9.83%) /assets/ac_icon_transparent.png -- 45.54kb -> 42.00kb (7.76%) /assets/ac_plug_colored.png -- 17.98kb -> 16.72kb (7%) /assets/ac_black_plug.png -- 8.49kb -> 8.06kb (5.06%) /assets/ac_black_plug_hollow.png -- 10.30kb -> 9.95kb (3.4%) /build/appx/Square44x44Logo.png -- 1.69kb -> 1.64kb (2.89%) /assets/Square44x44Logo.png -- 1.90kb -> 1.85kb (2.83%) /assets/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /build/appx/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /assets/ac_white_plug.png -- 8.49kb -> 8.42kb (0.83%) Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> * Asyncification!!! Check `REVIEW` comments * More async for `src/discord` * update packages to latest minor version * Void some promises * Add some types - 93 problems left! * make DeepScan Happy * DeepScan part 2 * I am the Constant * preload must be `.mts` * Migrate electron context menu official package * fix bad preload on setup window * fix minor import oversights * fix modloader * Stop main window from continuing during setup * update packages, slow dependabot * Remove paste override, it seems to work without now * IPC typing * Package updates & a few more typings * fix linting errors in screenshare * use pnpm in actions * fix dev releaser? * update node build, fix dev one more time * release action is broke * Fix Release * update actions * actions are so finicky * remove delete-tag-and-release * add github token env * Hopefully this fixes the release workflow * [debug] * this should actually fix it * Fix typo in dev action * put everything in a dir and then get it * use a different releaser * correct release file location * action places it in a folder named x.zip, recurse into that and grab the actual files * Cleanup actions a bit * release is dependent on mac build * remove mac build * split linux arm and x86 * rely on linux arm * remove deprecated action * attempt to fix weird recursive zip * fix env * use pnpm in actions fix dev releaser? update node build, fix dev one more time release action is broke Fix Release update actions actions are so finicky remove delete-tag-and-release add github token env Hopefully this fixes the release workflow [debug] this should actually fix it Fix typo in dev action put everything in a dir and then get it use a different releaser correct release file location action places it in a folder named x.zip, recurse into that and grab the actual files Cleanup actions a bit release is dependent on mac build remove mac build split linux arm and x86 rely on linux arm remove deprecated action attempt to fix weird recursive zip fix env * don't globally install pnpm packages (I don't think the cache checks global) * Type the armcord window * Finalize typings * fix deepscan issues * fix screenshare preload * fix app quitting --------- Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: smartfrigde <37928912+smartfrigde@users.noreply.github.com>
2024-06-14 12:57:34 +00:00
const trayVerIcon = function () {
if (process.platform == "win32") {
return trayPath.resize({height: 16});
} else if (process.platform == "darwin") {
return trayPath.resize({height: 18});
} else if (process.platform == "linux") {
return trayPath.resize({height: 24});
}
return undefined;
};
2022-10-08 15:43:08 +00:00
if (process.platform == "darwin" && trayPath.getSize().height > 22) trayPath = trayPath.resize({height: 22});
Updates and Linting (#578) * Updates and Linting * fix lint task * [ImgBot] Optimize images *Total -- 404.98kb -> 304.38kb (24.84%) /assets/screenshot-1920x1080.png -- 205.00kb -> 123.21kb (39.9%) /build/appx/Square150x150Logo.png -- 9.63kb -> 7.71kb (20%) /assets/ac_icon.png -- 40.15kb -> 34.98kb (12.88%) /assets/StoreLogo.png -- 40.15kb -> 34.98kb (12.88%) /assets/Square150x150Logo.png -- 7.24kb -> 6.53kb (9.83%) /assets/ac_icon_transparent.png -- 45.54kb -> 42.00kb (7.76%) /assets/ac_plug_colored.png -- 17.98kb -> 16.72kb (7%) /assets/ac_black_plug.png -- 8.49kb -> 8.06kb (5.06%) /assets/ac_black_plug_hollow.png -- 10.30kb -> 9.95kb (3.4%) /build/appx/Square44x44Logo.png -- 1.69kb -> 1.64kb (2.89%) /assets/Square44x44Logo.png -- 1.90kb -> 1.85kb (2.83%) /assets/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /build/appx/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /assets/ac_white_plug.png -- 8.49kb -> 8.42kb (0.83%) Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> * Asyncification!!! Check `REVIEW` comments * More async for `src/discord` * update packages to latest minor version * Void some promises * Add some types - 93 problems left! * make DeepScan Happy * DeepScan part 2 * I am the Constant * preload must be `.mts` * Migrate electron context menu official package * fix bad preload on setup window * fix minor import oversights * fix modloader * Stop main window from continuing during setup * update packages, slow dependabot * Remove paste override, it seems to work without now * IPC typing * Package updates & a few more typings * fix linting errors in screenshare * use pnpm in actions * fix dev releaser? * update node build, fix dev one more time * release action is broke * Fix Release * update actions * actions are so finicky * remove delete-tag-and-release * add github token env * Hopefully this fixes the release workflow * [debug] * this should actually fix it * Fix typo in dev action * put everything in a dir and then get it * use a different releaser * correct release file location * action places it in a folder named x.zip, recurse into that and grab the actual files * Cleanup actions a bit * release is dependent on mac build * remove mac build * split linux arm and x86 * rely on linux arm * remove deprecated action * attempt to fix weird recursive zip * fix env * use pnpm in actions fix dev releaser? update node build, fix dev one more time release action is broke Fix Release update actions actions are so finicky remove delete-tag-and-release add github token env Hopefully this fixes the release workflow [debug] this should actually fix it Fix typo in dev action put everything in a dir and then get it use a different releaser correct release file location action places it in a folder named x.zip, recurse into that and grab the actual files Cleanup actions a bit release is dependent on mac build remove mac build split linux arm and x86 rely on linux arm remove deprecated action attempt to fix weird recursive zip fix env * don't globally install pnpm packages (I don't think the cache checks global) * Type the armcord window * Finalize typings * fix deepscan issues * fix screenshare preload * fix app quitting --------- Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: smartfrigde <37928912+smartfrigde@users.noreply.github.com>
2024-06-14 12:57:34 +00:00
if (getConfig("tray")) {
const clientName = getConfig("clientName") ?? "ArmCord";
2023-06-11 15:18:00 +00:00
tray = new Tray(trayPath);
if (finishedSetup == false) {
const contextMenu = Menu.buildFromTemplate([
{
label: `Finish the setup first!`,
enabled: false
},
{
label: `Quit ${clientName}`,
Updates and Linting (#578) * Updates and Linting * fix lint task * [ImgBot] Optimize images *Total -- 404.98kb -> 304.38kb (24.84%) /assets/screenshot-1920x1080.png -- 205.00kb -> 123.21kb (39.9%) /build/appx/Square150x150Logo.png -- 9.63kb -> 7.71kb (20%) /assets/ac_icon.png -- 40.15kb -> 34.98kb (12.88%) /assets/StoreLogo.png -- 40.15kb -> 34.98kb (12.88%) /assets/Square150x150Logo.png -- 7.24kb -> 6.53kb (9.83%) /assets/ac_icon_transparent.png -- 45.54kb -> 42.00kb (7.76%) /assets/ac_plug_colored.png -- 17.98kb -> 16.72kb (7%) /assets/ac_black_plug.png -- 8.49kb -> 8.06kb (5.06%) /assets/ac_black_plug_hollow.png -- 10.30kb -> 9.95kb (3.4%) /build/appx/Square44x44Logo.png -- 1.69kb -> 1.64kb (2.89%) /assets/Square44x44Logo.png -- 1.90kb -> 1.85kb (2.83%) /assets/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /build/appx/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /assets/ac_white_plug.png -- 8.49kb -> 8.42kb (0.83%) Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> * Asyncification!!! Check `REVIEW` comments * More async for `src/discord` * update packages to latest minor version * Void some promises * Add some types - 93 problems left! * make DeepScan Happy * DeepScan part 2 * I am the Constant * preload must be `.mts` * Migrate electron context menu official package * fix bad preload on setup window * fix minor import oversights * fix modloader * Stop main window from continuing during setup * update packages, slow dependabot * Remove paste override, it seems to work without now * IPC typing * Package updates & a few more typings * fix linting errors in screenshare * use pnpm in actions * fix dev releaser? * update node build, fix dev one more time * release action is broke * Fix Release * update actions * actions are so finicky * remove delete-tag-and-release * add github token env * Hopefully this fixes the release workflow * [debug] * this should actually fix it * Fix typo in dev action * put everything in a dir and then get it * use a different releaser * correct release file location * action places it in a folder named x.zip, recurse into that and grab the actual files * Cleanup actions a bit * release is dependent on mac build * remove mac build * split linux arm and x86 * rely on linux arm * remove deprecated action * attempt to fix weird recursive zip * fix env * use pnpm in actions fix dev releaser? update node build, fix dev one more time release action is broke Fix Release update actions actions are so finicky remove delete-tag-and-release add github token env Hopefully this fixes the release workflow [debug] this should actually fix it Fix typo in dev action put everything in a dir and then get it use a different releaser correct release file location action places it in a folder named x.zip, recurse into that and grab the actual files Cleanup actions a bit release is dependent on mac build remove mac build split linux arm and x86 rely on linux arm remove deprecated action attempt to fix weird recursive zip fix env * don't globally install pnpm packages (I don't think the cache checks global) * Type the armcord window * Finalize typings * fix deepscan issues * fix screenshare preload * fix app quitting --------- Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: smartfrigde <37928912+smartfrigde@users.noreply.github.com>
2024-06-14 12:57:34 +00:00
click() {
fs.unlink(getConfigLocation(), (err) => {
2023-06-11 15:18:00 +00:00
if (err) throw err;
2022-10-08 15:43:08 +00:00
2023-06-11 15:18:00 +00:00
console.log('Closed during setup. "settings.json" was deleted');
app.quit();
});
}
2023-06-10 20:54:46 +00:00
}
2023-06-11 15:18:00 +00:00
]);
2023-06-10 20:54:46 +00:00
tray.setContextMenu(contextMenu);
} else {
2023-06-11 15:18:00 +00:00
const contextMenu = Menu.buildFromTemplate([
Updates and Linting (#578) * Updates and Linting * fix lint task * [ImgBot] Optimize images *Total -- 404.98kb -> 304.38kb (24.84%) /assets/screenshot-1920x1080.png -- 205.00kb -> 123.21kb (39.9%) /build/appx/Square150x150Logo.png -- 9.63kb -> 7.71kb (20%) /assets/ac_icon.png -- 40.15kb -> 34.98kb (12.88%) /assets/StoreLogo.png -- 40.15kb -> 34.98kb (12.88%) /assets/Square150x150Logo.png -- 7.24kb -> 6.53kb (9.83%) /assets/ac_icon_transparent.png -- 45.54kb -> 42.00kb (7.76%) /assets/ac_plug_colored.png -- 17.98kb -> 16.72kb (7%) /assets/ac_black_plug.png -- 8.49kb -> 8.06kb (5.06%) /assets/ac_black_plug_hollow.png -- 10.30kb -> 9.95kb (3.4%) /build/appx/Square44x44Logo.png -- 1.69kb -> 1.64kb (2.89%) /assets/Square44x44Logo.png -- 1.90kb -> 1.85kb (2.83%) /assets/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /build/appx/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /assets/ac_white_plug.png -- 8.49kb -> 8.42kb (0.83%) Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> * Asyncification!!! Check `REVIEW` comments * More async for `src/discord` * update packages to latest minor version * Void some promises * Add some types - 93 problems left! * make DeepScan Happy * DeepScan part 2 * I am the Constant * preload must be `.mts` * Migrate electron context menu official package * fix bad preload on setup window * fix minor import oversights * fix modloader * Stop main window from continuing during setup * update packages, slow dependabot * Remove paste override, it seems to work without now * IPC typing * Package updates & a few more typings * fix linting errors in screenshare * use pnpm in actions * fix dev releaser? * update node build, fix dev one more time * release action is broke * Fix Release * update actions * actions are so finicky * remove delete-tag-and-release * add github token env * Hopefully this fixes the release workflow * [debug] * this should actually fix it * Fix typo in dev action * put everything in a dir and then get it * use a different releaser * correct release file location * action places it in a folder named x.zip, recurse into that and grab the actual files * Cleanup actions a bit * release is dependent on mac build * remove mac build * split linux arm and x86 * rely on linux arm * remove deprecated action * attempt to fix weird recursive zip * fix env * use pnpm in actions fix dev releaser? update node build, fix dev one more time release action is broke Fix Release update actions actions are so finicky remove delete-tag-and-release add github token env Hopefully this fixes the release workflow [debug] this should actually fix it Fix typo in dev action put everything in a dir and then get it use a different releaser correct release file location action places it in a folder named x.zip, recurse into that and grab the actual files Cleanup actions a bit release is dependent on mac build remove mac build split linux arm and x86 rely on linux arm remove deprecated action attempt to fix weird recursive zip fix env * don't globally install pnpm packages (I don't think the cache checks global) * Type the armcord window * Finalize typings * fix deepscan issues * fix screenshare preload * fix app quitting --------- Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: smartfrigde <37928912+smartfrigde@users.noreply.github.com>
2024-06-14 12:57:34 +00:00
// REVIEW - Awaiting any window creation will fail silently
2023-06-11 15:18:00 +00:00
{
label: `${clientName} ${getDisplayVersion()}`,
icon: trayVerIcon(),
enabled: false
},
{
type: "separator"
},
{
label: `Open ${clientName}`,
click() {
mainWindows.forEach((mainWindow) => {
mainWindow.show();
});
}
2023-06-11 15:18:00 +00:00
},
{
label: "Open Settings",
click() {
Updates and Linting (#578) * Updates and Linting * fix lint task * [ImgBot] Optimize images *Total -- 404.98kb -> 304.38kb (24.84%) /assets/screenshot-1920x1080.png -- 205.00kb -> 123.21kb (39.9%) /build/appx/Square150x150Logo.png -- 9.63kb -> 7.71kb (20%) /assets/ac_icon.png -- 40.15kb -> 34.98kb (12.88%) /assets/StoreLogo.png -- 40.15kb -> 34.98kb (12.88%) /assets/Square150x150Logo.png -- 7.24kb -> 6.53kb (9.83%) /assets/ac_icon_transparent.png -- 45.54kb -> 42.00kb (7.76%) /assets/ac_plug_colored.png -- 17.98kb -> 16.72kb (7%) /assets/ac_black_plug.png -- 8.49kb -> 8.06kb (5.06%) /assets/ac_black_plug_hollow.png -- 10.30kb -> 9.95kb (3.4%) /build/appx/Square44x44Logo.png -- 1.69kb -> 1.64kb (2.89%) /assets/Square44x44Logo.png -- 1.90kb -> 1.85kb (2.83%) /assets/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /build/appx/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /assets/ac_white_plug.png -- 8.49kb -> 8.42kb (0.83%) Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> * Asyncification!!! Check `REVIEW` comments * More async for `src/discord` * update packages to latest minor version * Void some promises * Add some types - 93 problems left! * make DeepScan Happy * DeepScan part 2 * I am the Constant * preload must be `.mts` * Migrate electron context menu official package * fix bad preload on setup window * fix minor import oversights * fix modloader * Stop main window from continuing during setup * update packages, slow dependabot * Remove paste override, it seems to work without now * IPC typing * Package updates & a few more typings * fix linting errors in screenshare * use pnpm in actions * fix dev releaser? * update node build, fix dev one more time * release action is broke * Fix Release * update actions * actions are so finicky * remove delete-tag-and-release * add github token env * Hopefully this fixes the release workflow * [debug] * this should actually fix it * Fix typo in dev action * put everything in a dir and then get it * use a different releaser * correct release file location * action places it in a folder named x.zip, recurse into that and grab the actual files * Cleanup actions a bit * release is dependent on mac build * remove mac build * split linux arm and x86 * rely on linux arm * remove deprecated action * attempt to fix weird recursive zip * fix env * use pnpm in actions fix dev releaser? update node build, fix dev one more time release action is broke Fix Release update actions actions are so finicky remove delete-tag-and-release add github token env Hopefully this fixes the release workflow [debug] this should actually fix it Fix typo in dev action put everything in a dir and then get it use a different releaser correct release file location action places it in a folder named x.zip, recurse into that and grab the actual files Cleanup actions a bit release is dependent on mac build remove mac build split linux arm and x86 rely on linux arm remove deprecated action attempt to fix weird recursive zip fix env * don't globally install pnpm packages (I don't think the cache checks global) * Type the armcord window * Finalize typings * fix deepscan issues * fix screenshare preload * fix app quitting --------- Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: smartfrigde <37928912+smartfrigde@users.noreply.github.com>
2024-06-14 12:57:34 +00:00
void createSettingsWindow();
}
2023-06-11 15:18:00 +00:00
},
{
label: "Support Discord Server",
click() {
Updates and Linting (#578) * Updates and Linting * fix lint task * [ImgBot] Optimize images *Total -- 404.98kb -> 304.38kb (24.84%) /assets/screenshot-1920x1080.png -- 205.00kb -> 123.21kb (39.9%) /build/appx/Square150x150Logo.png -- 9.63kb -> 7.71kb (20%) /assets/ac_icon.png -- 40.15kb -> 34.98kb (12.88%) /assets/StoreLogo.png -- 40.15kb -> 34.98kb (12.88%) /assets/Square150x150Logo.png -- 7.24kb -> 6.53kb (9.83%) /assets/ac_icon_transparent.png -- 45.54kb -> 42.00kb (7.76%) /assets/ac_plug_colored.png -- 17.98kb -> 16.72kb (7%) /assets/ac_black_plug.png -- 8.49kb -> 8.06kb (5.06%) /assets/ac_black_plug_hollow.png -- 10.30kb -> 9.95kb (3.4%) /build/appx/Square44x44Logo.png -- 1.69kb -> 1.64kb (2.89%) /assets/Square44x44Logo.png -- 1.90kb -> 1.85kb (2.83%) /assets/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /build/appx/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /assets/ac_white_plug.png -- 8.49kb -> 8.42kb (0.83%) Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> * Asyncification!!! Check `REVIEW` comments * More async for `src/discord` * update packages to latest minor version * Void some promises * Add some types - 93 problems left! * make DeepScan Happy * DeepScan part 2 * I am the Constant * preload must be `.mts` * Migrate electron context menu official package * fix bad preload on setup window * fix minor import oversights * fix modloader * Stop main window from continuing during setup * update packages, slow dependabot * Remove paste override, it seems to work without now * IPC typing * Package updates & a few more typings * fix linting errors in screenshare * use pnpm in actions * fix dev releaser? * update node build, fix dev one more time * release action is broke * Fix Release * update actions * actions are so finicky * remove delete-tag-and-release * add github token env * Hopefully this fixes the release workflow * [debug] * this should actually fix it * Fix typo in dev action * put everything in a dir and then get it * use a different releaser * correct release file location * action places it in a folder named x.zip, recurse into that and grab the actual files * Cleanup actions a bit * release is dependent on mac build * remove mac build * split linux arm and x86 * rely on linux arm * remove deprecated action * attempt to fix weird recursive zip * fix env * use pnpm in actions fix dev releaser? update node build, fix dev one more time release action is broke Fix Release update actions actions are so finicky remove delete-tag-and-release add github token env Hopefully this fixes the release workflow [debug] this should actually fix it Fix typo in dev action put everything in a dir and then get it use a different releaser correct release file location action places it in a folder named x.zip, recurse into that and grab the actual files Cleanup actions a bit release is dependent on mac build remove mac build split linux arm and x86 rely on linux arm remove deprecated action attempt to fix weird recursive zip fix env * don't globally install pnpm packages (I don't think the cache checks global) * Type the armcord window * Finalize typings * fix deepscan issues * fix screenshare preload * fix app quitting --------- Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: smartfrigde <37928912+smartfrigde@users.noreply.github.com>
2024-06-14 12:57:34 +00:00
void createInviteWindow("TnhxcqynZ2");
2023-06-11 15:18:00 +00:00
}
},
{
type: "separator"
},
{
label: `Quit ${clientName}`,
click() {
2024-06-15 09:41:35 +00:00
//NOTE - It would be better to unify isQuitting with forceQuit in window.ts that's used on macOS
isQuitting = true;
app.quit();
2023-06-11 15:18:00 +00:00
}
}
]);
tray.setContextMenu(contextMenu);
}
tray.setToolTip(clientName);
2023-06-10 20:54:46 +00:00
tray.on("click", function () {
mainWindows.forEach((mainWindow) => {
mainWindow.show();
});
2023-06-10 20:54:46 +00:00
});
2022-04-20 19:50:23 +00:00
} else {
Updates and Linting (#578) * Updates and Linting * fix lint task * [ImgBot] Optimize images *Total -- 404.98kb -> 304.38kb (24.84%) /assets/screenshot-1920x1080.png -- 205.00kb -> 123.21kb (39.9%) /build/appx/Square150x150Logo.png -- 9.63kb -> 7.71kb (20%) /assets/ac_icon.png -- 40.15kb -> 34.98kb (12.88%) /assets/StoreLogo.png -- 40.15kb -> 34.98kb (12.88%) /assets/Square150x150Logo.png -- 7.24kb -> 6.53kb (9.83%) /assets/ac_icon_transparent.png -- 45.54kb -> 42.00kb (7.76%) /assets/ac_plug_colored.png -- 17.98kb -> 16.72kb (7%) /assets/ac_black_plug.png -- 8.49kb -> 8.06kb (5.06%) /assets/ac_black_plug_hollow.png -- 10.30kb -> 9.95kb (3.4%) /build/appx/Square44x44Logo.png -- 1.69kb -> 1.64kb (2.89%) /assets/Square44x44Logo.png -- 1.90kb -> 1.85kb (2.83%) /assets/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /build/appx/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%) /assets/ac_white_plug.png -- 8.49kb -> 8.42kb (0.83%) Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> * Asyncification!!! Check `REVIEW` comments * More async for `src/discord` * update packages to latest minor version * Void some promises * Add some types - 93 problems left! * make DeepScan Happy * DeepScan part 2 * I am the Constant * preload must be `.mts` * Migrate electron context menu official package * fix bad preload on setup window * fix minor import oversights * fix modloader * Stop main window from continuing during setup * update packages, slow dependabot * Remove paste override, it seems to work without now * IPC typing * Package updates & a few more typings * fix linting errors in screenshare * use pnpm in actions * fix dev releaser? * update node build, fix dev one more time * release action is broke * Fix Release * update actions * actions are so finicky * remove delete-tag-and-release * add github token env * Hopefully this fixes the release workflow * [debug] * this should actually fix it * Fix typo in dev action * put everything in a dir and then get it * use a different releaser * correct release file location * action places it in a folder named x.zip, recurse into that and grab the actual files * Cleanup actions a bit * release is dependent on mac build * remove mac build * split linux arm and x86 * rely on linux arm * remove deprecated action * attempt to fix weird recursive zip * fix env * use pnpm in actions fix dev releaser? update node build, fix dev one more time release action is broke Fix Release update actions actions are so finicky remove delete-tag-and-release add github token env Hopefully this fixes the release workflow [debug] this should actually fix it Fix typo in dev action put everything in a dir and then get it use a different releaser correct release file location action places it in a folder named x.zip, recurse into that and grab the actual files Cleanup actions a bit release is dependent on mac build remove mac build split linux arm and x86 rely on linux arm remove deprecated action attempt to fix weird recursive zip fix env * don't globally install pnpm packages (I don't think the cache checks global) * Type the armcord window * Finalize typings * fix deepscan issues * fix screenshare preload * fix app quitting --------- Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com> Co-authored-by: smartfrigde <37928912+smartfrigde@users.noreply.github.com>
2024-06-14 12:57:34 +00:00
if (getConfig("tray") == undefined) {
2023-06-10 21:05:39 +00:00
if (process.platform == "linux") {
2023-06-10 21:04:27 +00:00
const options: MessageBoxOptions = {
2023-06-10 20:54:46 +00:00
type: "question",
buttons: ["Yes, please", "No, I don't"],
defaultId: 1,
title: "Tray icon choice",
message: `Do you want to use tray icons?`,
detail: "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."
};
2022-10-08 15:43:08 +00:00
await dialog.showMessageBox(mainWindows[0], options).then(({response}) => {
2023-06-10 20:54:46 +00:00
if (response == 0) {
setConfig("tray", true);
} else {
setConfig("tray", false);
}
2023-06-10 20:54:46 +00:00
app.relaunch();
app.exit();
});
} else {
setConfig("tray", true);
app.relaunch();
app.exit();
}
}
2022-10-08 15:43:08 +00:00
}
});