HideAttachments: allow hiding stickers (#13)
Self explanatory Reviewed-on: https://codeberg.org/Ven/cord/pulls/13 Co-authored-by: Luna <imlvnaa@gmail.com> Co-committed-by: Luna <imlvnaa@gmail.com>
This commit is contained in:
parent
223b0366c6
commit
860d6edc7b
1 changed files with 2 additions and 2 deletions
|
@ -49,7 +49,7 @@ export default definePlugin({
|
||||||
await this.buildCss();
|
await this.buildCss();
|
||||||
|
|
||||||
addButton("HideAttachments", msg => {
|
addButton("HideAttachments", msg => {
|
||||||
if (!msg.attachments.length && !msg.embeds.length) return null;
|
if (!msg.attachments.length && !msg.embeds.length && !msg.stickerItems.length) return null;
|
||||||
|
|
||||||
const isHidden = hiddenMessages.has(msg.id);
|
const isHidden = hiddenMessages.has(msg.id);
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ export default definePlugin({
|
||||||
async buildCss() {
|
async buildCss() {
|
||||||
const elements = [...hiddenMessages].map(id => `#message-accessories-${id}`).join(",");
|
const elements = [...hiddenMessages].map(id => `#message-accessories-${id}`).join(",");
|
||||||
style.textContent = `
|
style.textContent = `
|
||||||
:is(${elements}) [class*="embedWrapper"] {
|
:is(${elements}) :is([class*="embedWrapper", [class*"clickableSticker"]) {
|
||||||
/* important is not necessary, but add it to make sure bad themes won't break it */
|
/* important is not necessary, but add it to make sure bad themes won't break it */
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue