aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-11-25 18:06:31 +0100
committerVendicated <vendicated@riseup.net>2022-11-25 18:06:31 +0100
commitbb398970ef7d60c68191f5e6e153bdba24e07207 (patch)
tree5d361dcb1dd8e287e0a8e66a42ed31d27c20eaa6 /src
parent50a96e804781731060e0303b9564b8aa9da180b5 (diff)
downloadVencord-bb398970ef7d60c68191f5e6e153bdba24e07207.tar.gz
Vencord-bb398970ef7d60c68191f5e6e153bdba24e07207.tar.bz2
Vencord-bb398970ef7d60c68191f5e6e153bdba24e07207.zip
HideAttachments: Fix embeds
Closes #259
Diffstat (limited to 'src')
-rw-r--r--src/plugins/HideAttachments.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/HideAttachments.tsx b/src/plugins/HideAttachments.tsx
index 067b4f0..0789214 100644
--- a/src/plugins/HideAttachments.tsx
+++ b/src/plugins/HideAttachments.tsx
@@ -99,7 +99,7 @@ export default definePlugin({
icon: isHidden ? ImageVisible : ImageInvisible,
message: msg,
channel: ChannelStore.getChannel(msg.channel_id),
- onClick: () => this.toggleHide(msg)
+ onClick: () => this.toggleHide(msg.id)
});
} catch (err) {
new Logger("HideAttachments").error(err);
@@ -107,10 +107,10 @@ export default definePlugin({
}
},
- async toggleHide(message: Message) {
+ async toggleHide(id: string) {
const ids = await getHiddenMessages();
- if (!ids.delete(message.id))
- ids.add(message.id);
+ if (!ids.delete(id))
+ ids.add(id);
await saveHiddenMessages(ids);
await this.buildCss();
@@ -118,7 +118,7 @@ export default definePlugin({
// update is necessary to rerender the PopOver
FluxDispatcher.dispatch({
type: "MESSAGE_UPDATE",
- message
+ message: { id }
});
}
});