stuff
This commit is contained in:
parent
1df1e21b81
commit
79a3b6df25
|
@ -184,7 +184,7 @@ var OldTitleBar = (_ => {
|
||||||
if (this.SettingsUpdated) {
|
if (this.SettingsUpdated) {
|
||||||
delete this.SettingsUpdated;
|
delete this.SettingsUpdated;
|
||||||
|
|
||||||
BDFDB.ModuleUtils.forceAllUpdates(this);
|
this.forceUpdateAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ var ReadAllNotificationsButton = (_ => {
|
||||||
let loadedBlacklist = BDFDB.DataUtils.load(this, "blacklist");
|
let loadedBlacklist = BDFDB.DataUtils.load(this, "blacklist");
|
||||||
this.saveBlacklist(!BDFDB.ArrayUtils.is(loadedBlacklist) ? [] : loadedBlacklist);
|
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!");
|
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) {
|
if (window.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) {
|
||||||
this.stopping = true;
|
this.stopping = true;
|
||||||
|
|
||||||
BDFDB.ModuleUtils.forceAllUpdates(this);
|
this.forceUpdateAll();
|
||||||
|
|
||||||
BDFDB.PluginUtils.clear(this);
|
BDFDB.PluginUtils.clear(this);
|
||||||
}
|
}
|
||||||
|
@ -177,6 +177,14 @@ var ReadAllNotificationsButton = (_ => {
|
||||||
|
|
||||||
// Begin of own functions
|
// Begin of own functions
|
||||||
|
|
||||||
|
onSettingsClosed () {
|
||||||
|
if (this.SettingsUpdated) {
|
||||||
|
delete this.SettingsUpdated;
|
||||||
|
|
||||||
|
this.forceUpdateAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onUserContextMenu (e) {
|
onUserContextMenu (e) {
|
||||||
if (e.instance.props.channel && e.type == "DMUserContextMenu") {
|
if (e.instance.props.channel && e.type == "DMUserContextMenu") {
|
||||||
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: BDFDB.LibraryComponents.MenuItems.MenuGroup});
|
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: BDFDB.LibraryComponents.MenuItems.MenuGroup});
|
||||||
|
@ -218,7 +226,7 @@ var ReadAllNotificationsButton = (_ => {
|
||||||
style: {height: 20},
|
style: {height: 20},
|
||||||
children: "read all",
|
children: "read all",
|
||||||
onClick: _ => {
|
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.includeGuilds) this.markGuildsAsRead(settings.includeMuted ? BDFDB.GuildUtils.getAll() : BDFDB.GuildUtils.getUnread());
|
||||||
if (settings.includeDMs) BDFDB.DMUtils.markAsRead(BDFDB.DMUtils.getAll());
|
if (settings.includeDMs) BDFDB.DMUtils.markAsRead(BDFDB.DMUtils.getAll());
|
||||||
};
|
};
|
||||||
|
@ -284,7 +292,6 @@ var ReadAllNotificationsButton = (_ => {
|
||||||
}
|
}
|
||||||
|
|
||||||
processRecentsHeader (e) {
|
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", {
|
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, {
|
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
|
||||||
text: `${BDFDB.LanguageUtils.LanguageStrings.CLOSE} (${BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ALL})`,
|
text: `${BDFDB.LanguageUtils.LanguageStrings.CLOSE} (${BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_ALL})`,
|
||||||
|
@ -338,6 +345,12 @@ var ReadAllNotificationsButton = (_ => {
|
||||||
blacklist = savedBlacklist;
|
blacklist = savedBlacklist;
|
||||||
BDFDB.DataUtils.save(savedBlacklist, this, "blacklist");
|
BDFDB.DataUtils.save(savedBlacklist, this, "blacklist");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
forceUpdateAll () {
|
||||||
|
settings = BDFDB.DataUtils.get(this, "settings");
|
||||||
|
|
||||||
|
BDFDB.ModuleUtils.forceAllUpdates(this);
|
||||||
|
}
|
||||||
|
|
||||||
setLabelsByLanguage () {
|
setLabelsByLanguage () {
|
||||||
switch (BDFDB.LanguageUtils.getLanguage().id) {
|
switch (BDFDB.LanguageUtils.getLanguage().id) {
|
||||||
|
|
Loading…
Reference in New Issue