Update ShowHiddenChannels.plugin.js

This commit is contained in:
Mirco Wittrien 2022-04-18 07:38:29 +02:00 committed by GitHub
parent 23312e5613
commit 69ba3c836b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -2,7 +2,7 @@
* @name ShowHiddenChannels * @name ShowHiddenChannels
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 3.0.7 * @version 3.0.8
* @description Displays all hidden Channels, which can't be accessed due to Role Restrictions, this won't allow you to read them (impossible) * @description Displays all hidden Channels, which can't be accessed due to Role Restrictions, this won't allow you to read them (impossible)
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -17,7 +17,7 @@ module.exports = (_ => {
"info": { "info": {
"name": "ShowHiddenChannels", "name": "ShowHiddenChannels",
"author": "DevilBro", "author": "DevilBro",
"version": "3.0.7", "version": "3.0.8",
"description": "Displays all hidden Channels, which can't be accessed due to Role Restrictions, this won't allow you to read them (impossible)" "description": "Displays all hidden Channels, which can't be accessed due to Role Restrictions, this won't allow you to read them (impossible)"
} }
}; };
@ -210,8 +210,7 @@ module.exports = (_ => {
} }
onStart () { onStart () {
let loadedBlackList = BDFDB.DataUtils.load(this, "blacklist"); this.saveBlackList(this.getBlackList());
this.saveBlackList(!BDFDB.ArrayUtils.is(loadedBlackList) ? [] : loadedBlackList);
let loadedCollapseList = BDFDB.DataUtils.load(this, "categorydata"); let loadedCollapseList = BDFDB.DataUtils.load(this, "categorydata");
this.saveCollapseList(!BDFDB.ArrayUtils.is(loadedCollapseList) ? [] : loadedCollapseList); this.saveCollapseList(!BDFDB.ArrayUtils.is(loadedCollapseList) ? [] : loadedCollapseList);
@ -550,6 +549,12 @@ module.exports = (_ => {
else this.saveBlackList([]); else this.saveBlackList([]);
BDFDB.PluginUtils.refreshSettingsPanel(this, settingsPanel, collapseStates); BDFDB.PluginUtils.refreshSettingsPanel(this, settingsPanel, collapseStates);
} }
getBlackList () {
let loadedBlackList = BDFDB.DataUtils.load(this, "blacklist");
return !BDFDB.ArrayUtils.is(loadedBlackList) ? [] : loadedBlackList;
}
saveBlackList (savedBlackList) { saveBlackList (savedBlackList) {
blackList = savedBlackList; blackList = savedBlackList;