From 89bb3ee30af21a5799507941ad0610164037f356 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 9 Oct 2024 03:18:31 +0200 Subject: [PATCH 1/4] SupportHelper: fix DM warning card --- src/plugins/_core/supportHelper.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/_core/supportHelper.tsx b/src/plugins/_core/supportHelper.tsx index 432896fc..d0ebdb33 100644 --- a/src/plugins/_core/supportHelper.tsx +++ b/src/plugins/_core/supportHelper.tsx @@ -149,8 +149,8 @@ export default definePlugin({ patches: [{ find: ".BEGINNING_DM.format", replacement: { - match: /BEGINNING_DM\.format\(\{.+?\}\),(?=.{0,100}userId:(\i\.getRecipientId\(\)))/, - replace: "$& $self.ContributorDmWarningCard({ userId: $1 })," + match: /BEGINNING_DM\.format\(\{.+?\}\),(?=.{0,300}(\i)\.isMultiUserDM)/, + replace: "$& $self.renderContributorDmWarningCard({ channel: $1 })," } }], @@ -235,7 +235,8 @@ export default definePlugin({ } }, - ContributorDmWarningCard: ErrorBoundary.wrap(({ userId }) => { + renderContributorDmWarningCard: ErrorBoundary.wrap(({ channel }) => { + const userId = channel.getRecipientId(); if (!isPluginDev(userId)) return null; if (RelationshipStore.isFriend(userId) || isPluginDev(UserStore.getCurrentUser()?.id)) return null; From 2dce060cf9c2fa431cf177987a00e572d9057759 Mon Sep 17 00:00:00 2001 From: programminglaboratorys <107296738+programminglaboratorys@users.noreply.github.com> Date: Wed, 9 Oct 2024 11:57:30 +0300 Subject: [PATCH 2/4] MessageClickActions: Fix editing messages which failed to send (#2677) --- src/plugins/messageClickActions/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/messageClickActions/index.ts b/src/plugins/messageClickActions/index.ts index 14899c36..7437cace 100644 --- a/src/plugins/messageClickActions/index.ts +++ b/src/plugins/messageClickActions/index.ts @@ -74,7 +74,7 @@ export default definePlugin({ if (msg.deleted === true) return; if (isMe) { - if (!settings.store.enableDoubleClickToEdit || EditStore.isEditing(channel.id, msg.id)) return; + if (!settings.store.enableDoubleClickToEdit || EditStore.isEditing(channel.id, msg.id) || msg.state !== "SENT") return; MessageActions.startEditMessage(channel.id, msg.id, msg.content); event.preventDefault(); From aa1b446c07484ee3504c79d0e49657f00bdebf67 Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Thu, 10 Oct 2024 08:14:52 -0400 Subject: [PATCH 3/4] ShowHiddenChannels: Fix re-organizing channels (#2942) --- src/plugins/showHiddenChannels/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index 7f008c8c..c74020f1 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -61,6 +61,10 @@ export const settings = definePluginSettings({ } }); +function isUncategorized(objChannel: { channel: Channel; comparator: number; }) { + return objChannel.channel.id === "null" && objChannel.channel.name === "Uncategorized" && objChannel.comparator === -1; +} + export default definePlugin({ name: "ShowHiddenChannels", description: "Show channels that you do not have access to view.", @@ -503,7 +507,7 @@ export default definePlugin({ res[key] ??= []; for (const objChannel of maybeObjChannels) { - if (objChannel.channel.id === null || !this.isHiddenChannel(objChannel.channel)) res[key].push(objChannel); + if (isUncategorized(objChannel) || objChannel.channel.id === null || !this.isHiddenChannel(objChannel.channel)) res[key].push(objChannel); } } From e818905520b3e14d50ece546cfaf48f85d2719e7 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Thu, 10 Oct 2024 09:13:57 -0300 Subject: [PATCH 4/4] Workaround https://github.com/electron/electron/issues/43367 --- src/main/patcher.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/patcher.ts b/src/main/patcher.ts index e5b87290..e858f3fc 100644 --- a/src/main/patcher.ts +++ b/src/main/patcher.ts @@ -17,7 +17,7 @@ */ import { onceDefined } from "@shared/onceDefined"; -import electron, { app, BrowserWindowConstructorOptions, Menu } from "electron"; +import electron, { app, BrowserWindowConstructorOptions, Menu, nativeTheme } from "electron"; import { dirname, join } from "path"; import { initIpc } from "./ipcMain"; @@ -100,6 +100,19 @@ if (!IS_VANILLA) { super(options); initIpc(this); + + // Workaround for https://github.com/electron/electron/issues/43367. Vesktop also has its own workaround + // @TODO: Remove this when the issue is fixed + if (IS_DISCORD_DESKTOP) { + this.webContents.on("devtools-opened", () => { + if (!nativeTheme.shouldUseDarkColors) return; + + nativeTheme.themeSource = "light"; + setTimeout(() => { + nativeTheme.themeSource = "dark"; + }, 100); + }); + } } else super(options); } }