From d5d2fcfac44de8e10811a6c596c94536b86805b9 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Mon, 9 Aug 2021 16:56:23 +0200 Subject: [PATCH] stuff --- Library/0BDFDB.plugin.js | 5 ++++- Library/_res/BDFDB.data.json | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Library/0BDFDB.plugin.js b/Library/0BDFDB.plugin.js index a8d9b1e752..8f731b1ea0 100644 --- a/Library/0BDFDB.plugin.js +++ b/Library/0BDFDB.plugin.js @@ -2356,7 +2356,10 @@ module.exports = (_ => { for (let name in InternalData.LibraryModules) { if (InternalData.LibraryModules[name].props) { - if (InternalData.LibraryModules[name].nonProps) LibraryModules[name] = BDFDB.ModuleUtils.find(m => InternalData.LibraryModules[name].props.every(prop => typeof m[prop] == "function") && InternalData.LibraryModules[name].nonProps.every(prop => typeof m[prop] != "function")); + if (InternalData.LibraryModules[name].nonProps) LibraryModules[name] = BDFDB.ModuleUtils.find(m => InternalData.LibraryModules[name].props.every(prop => { + const value = m[prop]; + return value !== undefined && !(typeof value == "string" && !value); + }) && InternalData.LibraryModules[name].nonProps.every(prop => m[prop] === undefined)); else LibraryModules[name] = BDFDB.ModuleUtils.findByProperties(InternalData.LibraryModules[name].props); } else if (InternalData.LibraryModules[name].strings) LibraryModules[name] = BDFDB.ModuleUtils.findByString(InternalData.LibraryModules[name].strings); diff --git a/Library/_res/BDFDB.data.json b/Library/_res/BDFDB.data.json index 25087ae8a5..27cc3bc01b 100644 --- a/Library/_res/BDFDB.data.json +++ b/Library/_res/BDFDB.data.json @@ -117,7 +117,7 @@ "SettingsUtils": {"props": ["updateRemoteSettings", "updateLocalSettings"]}, "SimpleMarkdownComponents": {"strings": ["customEmoji", "emojiTooltipPosition", "timestampTooltip"]}, "SimpleMarkdownParser": {"props": ["parseBlock", "parseInline", "defaultOutput"]}, - "SlateUtils": {"props": ["serialize", "deserialize"], "notProps": ["getFlag"]}, + "SlateUtils": {"props": ["serialize", "deserialize"], "nonProps": ["getFlag"]}, "SlateSelectionUtils": {"props": ["serialize", "serializeSelection"]}, "SlowmodeUtils": {"props": ["getSlowmodeCooldownGuess"]}, "SoundParser": {"strings": ["discodo", "ddr-down", "mute"]}, @@ -138,7 +138,7 @@ "TimestampUtils": {"props": ["fromTimestamp", "extractTimestamp"]}, "TimeUtils": {"props": ["calendarFormat", "dateFormat"]}, "ThreadStore": {"props": ["isActive", "getThreadsForGuild"]}, - "UnreadGuildUtils": {"props": ["hasUnread", "getMentionCount"], "notProps": ["getOldestUnreadMessageId"]}, + "UnreadGuildUtils": {"props": ["hasUnread", "getMentionCount"], "nonProps": ["getOldestUnreadMessageId"]}, "UnreadChannelUtils": {"props": ["getUnreadCount", "getOldestUnreadMessageId"]}, "UploadUtils": {"props": ["upload", "instantBatchUpload"]}, "URLParser": {"props": ["parse", "resolveObject"]},