This commit is contained in:
Mirco Wittrien 2020-06-09 10:14:35 +02:00
parent 1df1e21b81
commit 79a3b6df25
2 changed files with 18 additions and 5 deletions

View File

@ -184,7 +184,7 @@ var OldTitleBar = (_ => {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
BDFDB.ModuleUtils.forceAllUpdates(this);
this.forceUpdateAll();
}
}

View File

@ -159,7 +159,7 @@ var ReadAllNotificationsButton = (_ => {
let loadedBlacklist = BDFDB.DataUtils.load(this, "blacklist");
this.saveBlacklist(!BDFDB.ArrayUtils.is(loadedBlacklist) ? [] : loadedBlacklist);
BDFDB.ModuleUtils.forceAllUpdates(this);
this.forceUpdateAll();
}
else console.error(`%c[${this.getName()}]%c`, "color: #3a71c1; font-weight: 700;", "", "Fatal Error: Could not load BD functions!");
}
@ -168,7 +168,7 @@ var ReadAllNotificationsButton = (_ => {
if (window.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) {
this.stopping = true;
BDFDB.ModuleUtils.forceAllUpdates(this);
this.forceUpdateAll();
BDFDB.PluginUtils.clear(this);
}
@ -177,6 +177,14 @@ var ReadAllNotificationsButton = (_ => {
// Begin of own functions
onSettingsClosed () {
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
}
}
onUserContextMenu (e) {
if (e.instance.props.channel && e.type == "DMUserContextMenu") {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: BDFDB.LibraryComponents.MenuItems.MenuGroup});
@ -218,7 +226,7 @@ var ReadAllNotificationsButton = (_ => {
style: {height: 20},
children: "read all",
onClick: _ => {
let settings = BDFDB.DataUtils.get(this, "settings"), clear = _ => {
let clear = _ => {
if (settings.includeGuilds) this.markGuildsAsRead(settings.includeMuted ? BDFDB.GuildUtils.getAll() : BDFDB.GuildUtils.getUnread());
if (settings.includeDMs) BDFDB.DMUtils.markAsRead(BDFDB.DMUtils.getAll());
};
@ -284,7 +292,6 @@ var ReadAllNotificationsButton = (_ => {
}
processRecentsHeader (e) {
let settings = BDFDB.DataUtils.get(this, "settings");
if (settings.addClearButton && e.instance.props.tab == "Recent Mentions") e.returnvalue.props.children.push(BDFDB.ReactUtils.createElement("div", {
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: `${BDFDB.LanguageUtils.LanguageStrings.CLOSE} (${BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ALL})`,
@ -338,6 +345,12 @@ var ReadAllNotificationsButton = (_ => {
blacklist = savedBlacklist;
BDFDB.DataUtils.save(savedBlacklist, this, "blacklist");
}
forceUpdateAll () {
settings = BDFDB.DataUtils.get(this, "settings");
BDFDB.ModuleUtils.forceAllUpdates(this);
}
setLabelsByLanguage () {
switch (BDFDB.LanguageUtils.getLanguage().id) {