diff options
author | Hugo C <lumap@duck.com> | 2023-08-31 01:00:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-31 01:00:16 +0200 |
commit | d6efd99849dfc21ee3d7b077430e6e4ad76aa03e (patch) | |
tree | 314ac810869ce8a6ff369c50c12e16408d8ec737 /src/plugins/messageLinkEmbeds.tsx | |
parent | fe6be987fdc456a722f360cae4af6845da71e13f (diff) | |
download | Vencord-d6efd99849dfc21ee3d7b077430e6e4ad76aa03e.tar.gz Vencord-d6efd99849dfc21ee3d7b077430e6e4ad76aa03e.tar.bz2 Vencord-d6efd99849dfc21ee3d7b077430e6e4ad76aa03e.zip |
messageLinkEmbeds: fix AutoModEmbed on compact mode (#1691)
Co-authored-by: V <vendicated@riseup.net>
Diffstat (limited to 'src/plugins/messageLinkEmbeds.tsx')
-rw-r--r-- | src/plugins/messageLinkEmbeds.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/messageLinkEmbeds.tsx b/src/plugins/messageLinkEmbeds.tsx index 5e9eff2..c7b3bd0 100644 --- a/src/plugins/messageLinkEmbeds.tsx +++ b/src/plugins/messageLinkEmbeds.tsx @@ -18,6 +18,7 @@ import { addAccessory } from "@api/MessageAccessories"; import { definePluginSettings } from "@api/Settings"; +import { getSettingStoreLazy } from "@api/SettingsStore"; import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants.js"; import { classes } from "@utils/misc"; @@ -318,9 +319,10 @@ function ChannelMessageEmbedAccessory({ message, channel, guildID }: MessageEmbe />; } +const compactModeEnabled = getSettingStoreLazy<boolean>("textAndImages", "messageDisplayCompact")!; + function AutomodEmbedAccessory(props: MessageEmbedProps): JSX.Element | null { const { message, channel, guildID } = props; - const isDM = guildID === "@me"; const images = getImages(message); const { parse } = Parser; @@ -336,7 +338,7 @@ function AutomodEmbedAccessory(props: MessageEmbedProps): JSX.Element | null { <span>{isDM ? " - Direct Message" : " - " + GuildStore.getGuild(channel.guild_id)?.name}</span> </Text> } - compact={false} + compact={compactModeEnabled.getSetting()} content={ <> {message.content || message.attachments.length <= images.length @@ -363,7 +365,7 @@ export default definePlugin({ name: "MessageLinkEmbeds", description: "Adds a preview to messages that link another message", authors: [Devs.TheSun, Devs.Ven, Devs.RyanCaoDev], - dependencies: ["MessageAccessoriesAPI"], + dependencies: ["MessageAccessoriesAPI", "SettingsStoreAPI"], patches: [ { find: ".embedCard", |