mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-24 07:25:10 +00:00
Fix: fix detection for attachments again
This commit is contained in:
parent
d001022ec7
commit
6bf49e25aa
1 changed files with 6 additions and 2 deletions
|
@ -22,6 +22,7 @@ import { ImageInvisible, ImageVisible } from "@components/Icons";
|
|||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { ChannelStore } from "@webpack/common";
|
||||
import { MessageSnapshot } from "@webpack/types";
|
||||
|
||||
import { ILoadMessagesSuccessPayload, IMessage, IMessageCreatePayload, IMessageUpdatePayload } from "./types";
|
||||
import { isStringEmpty } from "./utils";
|
||||
|
@ -182,8 +183,11 @@ export default definePlugin({
|
|||
|
||||
settings,
|
||||
|
||||
renderMessagePopoverButton(msg: IMessage) {
|
||||
const hasAttachmentsInSnapshots = !Array.isArray(msg.message_snapshots);
|
||||
renderMessagePopoverButton(msg) {
|
||||
// @ts-ignore - discord-types lags behind discord.
|
||||
const hasAttachmentsInSnapshots = msg.messageSnapshots.some(
|
||||
(snapshot: MessageSnapshot) => snapshot?.message.attachments.length || snapshot?.message.embeds.length > 0
|
||||
);
|
||||
if (!msg.attachments.length && !msg.embeds.length && !msg.stickerItems.length && !hasAttachmentsInSnapshots) {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue