mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-28 02:06:23 +00:00
make it togglable
This commit is contained in:
parent
f01f1e03cc
commit
f2b6dcbb91
1 changed files with 21 additions and 10 deletions
|
@ -5,8 +5,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { addButton, removeButton } from "@api/MessagePopover";
|
import { addButton, removeButton } from "@api/MessagePopover";
|
||||||
|
import { Settings } from "@api/Settings";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { ChannelStore } from "@webpack/common";
|
import { ChannelStore } from "@webpack/common";
|
||||||
import { get, set } from "@api/DataStore";
|
import { get, set } from "@api/DataStore";
|
||||||
|
|
||||||
|
@ -33,6 +34,13 @@ export default definePlugin({
|
||||||
description: "Adds an option to hide messages",
|
description: "Adds an option to hide messages",
|
||||||
authors: [Devs.Isaac],
|
authors: [Devs.Isaac],
|
||||||
dependencies: ["MessagePopoverAPI"],
|
dependencies: ["MessagePopoverAPI"],
|
||||||
|
options: {
|
||||||
|
showMessageHiddenText: {
|
||||||
|
description: `Hidden messages will contain a small text indicating they're hidden.`,
|
||||||
|
type: OptionType.BOOLEAN,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
async start() {
|
async start() {
|
||||||
style = document.createElement("style");
|
style = document.createElement("style");
|
||||||
|
@ -70,19 +78,22 @@ export default definePlugin({
|
||||||
:is(${messagesContent}) {
|
:is(${messagesContent}) {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
:is(${messagesContent})::after {
|
|
||||||
visibility: visible;
|
|
||||||
content: "Message hidden" !important;
|
|
||||||
color: var(--text-muted);
|
|
||||||
font-size: 80%;
|
|
||||||
position: absolute;
|
|
||||||
display: block;
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
:is(${messagesAccessories}) {
|
:is(${messagesAccessories}) {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
if (Settings.plugins.HideMessage.showMessageHiddenText) {
|
||||||
|
style.textContent += `
|
||||||
|
:is(${messagesContent})::after {
|
||||||
|
visibility: visible;
|
||||||
|
content: "Message hidden" !important;
|
||||||
|
color: var(--text-muted);
|
||||||
|
font-size: 80%;
|
||||||
|
position: absolute;
|
||||||
|
display: block;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
`}
|
||||||
},
|
},
|
||||||
|
|
||||||
async toggleHide(sentIds: string) {
|
async toggleHide(sentIds: string) {
|
||||||
|
|
Loading…
Reference in a new issue