mirror of
https://github.com/Equicord/Equicord.git
synced 2025-02-07 11:43:42 -05:00
Fix KeywordNotify for stable
This commit is contained in:
parent
7aacd84c8e
commit
160835cbd3
1 changed files with 10 additions and 2 deletions
|
@ -11,6 +11,7 @@ import { definePluginSettings } from "@api/Settings";
|
||||||
import { classNameFactory } from "@api/Styles";
|
import { classNameFactory } from "@api/Styles";
|
||||||
import { Flex } from "@components/Flex";
|
import { Flex } from "@components/Flex";
|
||||||
import { DeleteIcon } from "@components/Icons";
|
import { DeleteIcon } from "@components/Icons";
|
||||||
|
import { onceDefined } from "@shared/onceDefined";
|
||||||
import { EquicordDevs } from "@utils/constants";
|
import { EquicordDevs } from "@utils/constants";
|
||||||
import { Margins } from "@utils/margins";
|
import { Margins } from "@utils/margins";
|
||||||
import { classes } from "@utils/misc";
|
import { classes } from "@utils/misc";
|
||||||
|
@ -32,8 +33,6 @@ let keywordLog: Array<any> = [];
|
||||||
const recentMentionsPopoutClass = findByPropsLazy("recentMentionsPopout");
|
const recentMentionsPopoutClass = findByPropsLazy("recentMentionsPopout");
|
||||||
const tabClass = findByPropsLazy("tab");
|
const tabClass = findByPropsLazy("tab");
|
||||||
const buttonClass = findByPropsLazy("size36");
|
const buttonClass = findByPropsLazy("size36");
|
||||||
|
|
||||||
const MenuHeader = findByCodeLazy(".getOverdueMessageReminderCount())");
|
|
||||||
const Popout = findByCodeLazy(".Messages.UNBLOCK_TO_JUMP_TITLE", "canCloseAllMessages:");
|
const Popout = findByCodeLazy(".Messages.UNBLOCK_TO_JUMP_TITLE", "canCloseAllMessages:");
|
||||||
const createMessageRecord = findByCodeLazy(".createFromServer(", ".isBlockedForMessage", "messageReference:");
|
const createMessageRecord = findByCodeLazy(".createFromServer(", ".isBlockedForMessage", "messageReference:");
|
||||||
const KEYWORD_ENTRIES_KEY = "KeywordNotify_keywordEntries";
|
const KEYWORD_ENTRIES_KEY = "KeywordNotify_keywordEntries";
|
||||||
|
@ -41,6 +40,15 @@ const KEYWORD_LOG_KEY = "KeywordNotify_log";
|
||||||
|
|
||||||
const cl = classNameFactory("vc-keywordnotify-");
|
const cl = classNameFactory("vc-keywordnotify-");
|
||||||
|
|
||||||
|
let MenuHeader;
|
||||||
|
onceDefined(window, "GLOBAL_ENV", v => {
|
||||||
|
if (v.RELEASE_CHANNEL === "canary") {
|
||||||
|
MenuHeader = findByCodeLazy(".getOverdueMessageReminderCount())");
|
||||||
|
} else {
|
||||||
|
MenuHeader = findByCodeLazy(".getMessageReminders()).length");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
async function addKeywordEntry(forceUpdate: () => void) {
|
async function addKeywordEntry(forceUpdate: () => void) {
|
||||||
keywordEntries.push({ regex: "", listIds: [], listType: ListType.BlackList, ignoreCase: false });
|
keywordEntries.push({ regex: "", listIds: [], listType: ListType.BlackList, ignoreCase: false });
|
||||||
await DataStore.set(KEYWORD_ENTRIES_KEY, keywordEntries);
|
await DataStore.set(KEYWORD_ENTRIES_KEY, keywordEntries);
|
||||||
|
|
Loading…
Reference in a new issue