From 8990f7a44d2d9ef35f8e1967a7b6a7c1368aba3e Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 26 Feb 2026 10:27:06 -0500 Subject: [PATCH] this is broken --- browser/VencordNativeStub.ts | 6 ------ misc/keys-mapping.json | 2 +- src/Vencord.ts | 37 ++---------------------------------- src/VencordNative.ts | 7 ------- src/main/trayMenu.ts | 24 +++++++++++------------ src/shared/IpcEvents.ts | 5 ----- 6 files changed, 14 insertions(+), 67 deletions(-) diff --git a/browser/VencordNativeStub.ts b/browser/VencordNativeStub.ts index 139bcd972..861aa00ca 100644 --- a/browser/VencordNativeStub.ts +++ b/browser/VencordNativeStub.ts @@ -135,10 +135,4 @@ window.VencordNative = { pluginHelpers: {} as any, csp: {} as any, - tray: { - setUpdateState: NOOP, - onCheckUpdates: NOOP, - onRepair: NOOP, - onAbout: NOOP, - }, }; diff --git a/misc/keys-mapping.json b/misc/keys-mapping.json index 38aa8e301..ae4e01502 100644 --- a/misc/keys-mapping.json +++ b/misc/keys-mapping.json @@ -19439,4 +19439,4 @@ "FD9mUy": "DESKTOP_DOWNLOAD_TITLE_LINUX", "hmGBzx": "DESKTOP_DOWNLOAD_TITLE_MAC", "GY/qwb": "DESKTOP_DOWNLOAD_TITLE_WINDOWS" -} +} \ No newline at end of file diff --git a/src/Vencord.ts b/src/Vencord.ts index 45c9326f1..e5bac2972 100644 --- a/src/Vencord.ts +++ b/src/Vencord.ts @@ -37,14 +37,14 @@ import { StartAt } from "@utils/types"; import { SettingsRouter } from "@webpack/common"; import { get as dsGet } from "./api/DataStore"; -import { popNotice, showNotice } from "./api/Notices"; +import { showNotice } from "./api/Notices"; import { NotificationData, showNotification } from "./api/Notifications"; import { initPluginManager, PMLogger, startAllPlugins } from "./api/PluginManager"; import { PlainSettings, Settings, SettingsStore } from "./api/Settings"; import { getCloudSettings, putCloudSettings, shouldCloudSync } from "./api/SettingsSync/cloudSync"; import { localStorage } from "./utils/localStorage"; import { relaunch } from "./utils/native"; -import { checkForUpdates, isOutdated as getIsOutdated, update, UpdateLogger } from "./utils/updater"; +import { checkForUpdates, update, UpdateLogger } from "./utils/updater"; import { onceReady } from "./webpack"; import { patches } from "./webpack/patchWebpack"; @@ -141,7 +141,6 @@ async function runUpdateCheck() { try { const isOutdated = await checkForUpdates(); - if (IS_DISCORD_DESKTOP) VencordNative.tray.setUpdateState(isOutdated); if (!isOutdated) return; if (Settings.autoUpdate) { @@ -172,43 +171,11 @@ async function runUpdateCheck() { } } -function initTrayIpc() { - if (IS_WEB || IS_UPDATER_DISABLED) return; - - VencordNative.tray.onCheckUpdates(async () => { - try { - const isOutdated = await checkForUpdates(); - VencordNative.tray.setUpdateState(isOutdated); - - if (isOutdated) { - showNotice("An Equicord update is available!", "View Update", () => openSettingsTabModal(UpdaterTab!)); - } else { - showNotice("No updates available, you're on the latest version!", "OK", popNotice); - } - } catch (err) { - UpdateLogger.error("Failed to check for updates from tray", err); - showNotice("Failed to check for updates, check the console for more info", "OK", popNotice); - } - }); - - VencordNative.tray.onRepair(async () => { - try { - await update(); - relaunch(); - } catch (err) { - UpdateLogger.error("Failed to repair Equicord", err); - } - }); - - VencordNative.tray.setUpdateState(getIsOutdated); -} - async function init() { await onceReady; startAllPlugins(StartAt.WebpackReady); syncSettings(); - initTrayIpc(); if (!IS_DEV && !IS_WEB && !IS_UPDATER_DISABLED) { runUpdateCheck(); diff --git a/src/VencordNative.ts b/src/VencordNative.ts index 7835e84c2..4c2232ff9 100644 --- a/src/VencordNative.ts +++ b/src/VencordNative.ts @@ -98,12 +98,5 @@ export default { invoke(IpcEvents.CSP_REQUEST_ADD_OVERRIDE, url, directives, callerName), }, - tray: { - setUpdateState: (available: boolean) => ipcRenderer.send(IpcEvents.SET_TRAY_UPDATE_STATE, available), - onCheckUpdates: (cb: () => void) => { ipcRenderer.on(IpcEvents.TRAY_CHECK_UPDATES, cb); }, - onRepair: (cb: () => void) => { ipcRenderer.on(IpcEvents.TRAY_REPAIR, cb); }, - onAbout: (cb: () => void) => { ipcRenderer.on(IpcEvents.TRAY_ABOUT, cb); }, - }, - pluginHelpers: PluginHelpers }; diff --git a/src/main/trayMenu.ts b/src/main/trayMenu.ts index d5c266490..b5a6a6304 100644 --- a/src/main/trayMenu.ts +++ b/src/main/trayMenu.ts @@ -6,17 +6,11 @@ import { IpcEvents } from "@shared/IpcEvents"; import { gitHashShort } from "@shared/vencordUserAgent"; -import { BrowserWindow, ipcMain, Menu, MenuItemConstructorOptions, shell } from "electron"; +import { BrowserWindow, Menu, MenuItemConstructorOptions, shell } from "electron"; import aboutHtml from "file://about.html?minify"; import { SETTINGS_DIR, THEMES_DIR } from "./utils/constants"; -let cachedUpdateAvailable = false; - -ipcMain.on(IpcEvents.SET_TRAY_UPDATE_STATE, (_, available: boolean) => { - cachedUpdateAvailable = available; -}); - function getMainWindow(): BrowserWindow | undefined { return BrowserWindow.getFocusedWindow() ?? BrowserWindow.getAllWindows()[0]; } @@ -101,12 +95,16 @@ function createEquicordMenuItems(): MenuItemConstructorOptions[] { click: () => openAboutWindow() }, { - label: cachedUpdateAvailable ? "Update Equicord" : "Check for Updates", - click: () => sendToRenderer(IpcEvents.TRAY_CHECK_UPDATES) - }, - { - label: "Repair Equicord", - click: () => sendToRenderer(IpcEvents.TRAY_REPAIR) + label: "Update Equicord", + click: async () => { + try { + sendToRenderer(IpcEvents.GET_UPDATES); + sendToRenderer(IpcEvents.UPDATE); + sendToRenderer(IpcEvents.BUILD); + } catch (err) { + console.error("Failed to check updates from tray", err); + } + } }, { type: "separator" }, { diff --git a/src/shared/IpcEvents.ts b/src/shared/IpcEvents.ts index eda8c407b..974fe0b5f 100644 --- a/src/shared/IpcEvents.ts +++ b/src/shared/IpcEvents.ts @@ -51,9 +51,4 @@ export const enum IpcEvents { GET_RENDERER_CSS = "VencordGetRendererCss", RENDERER_CSS_UPDATE = "VencordRendererCssUpdate", PRELOAD_GET_RENDERER_JS = "VencordPreloadGetRendererJs", - - SET_TRAY_UPDATE_STATE = "VencordSetTrayUpdateState", - TRAY_REPAIR = "VencordTrayRepair", - TRAY_CHECK_UPDATES = "VencordTrayCheckUpdates", - TRAY_ABOUT = "VencordTrayAbout" }