mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-24 15:35:11 +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 { Devs } from "@utils/constants";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { ChannelStore } from "@webpack/common";
|
import { ChannelStore } from "@webpack/common";
|
||||||
|
import { MessageSnapshot } from "@webpack/types";
|
||||||
|
|
||||||
import { ILoadMessagesSuccessPayload, IMessage, IMessageCreatePayload, IMessageUpdatePayload } from "./types";
|
import { ILoadMessagesSuccessPayload, IMessage, IMessageCreatePayload, IMessageUpdatePayload } from "./types";
|
||||||
import { isStringEmpty } from "./utils";
|
import { isStringEmpty } from "./utils";
|
||||||
|
@ -182,8 +183,11 @@ export default definePlugin({
|
||||||
|
|
||||||
settings,
|
settings,
|
||||||
|
|
||||||
renderMessagePopoverButton(msg: IMessage) {
|
renderMessagePopoverButton(msg) {
|
||||||
const hasAttachmentsInSnapshots = !Array.isArray(msg.message_snapshots);
|
// @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) {
|
if (!msg.attachments.length && !msg.embeds.length && !msg.stickerItems.length && !hasAttachmentsInSnapshots) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue