Update BetterFriendList.plugin.js

This commit is contained in:
Mirco Wittrien 2022-12-10 10:26:05 +01:00
parent 24cfe0f5d4
commit 4871f3aecf
1 changed files with 32 additions and 42 deletions

View File

@ -2,7 +2,7 @@
* @name BetterFriendList
* @author DevilBro
* @authorId 278543574059057154
* @version 1.4.8
* @version 1.4.9
* @description Adds extra Controls to the Friends Page, for example sort by Name/Status, Search and All/Request/Blocked Amount
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -96,8 +96,6 @@ module.exports = (_ => {
after: [
"PeopleList",
"PeopleListItem",
"PeopleListSectionedLazy",
"PeopleListSectionedNonLazy",
"TabBar"
],
componentDidMount: [
@ -274,7 +272,6 @@ module.exports = (_ => {
}
processPeopleListSectionedNonLazy (e) {
if (!e.returnvalue) {
if (this.settings.general.addFavorizedCategory) {
if (isFavoritesSelected) e.instance.props.statusSections = [].concat(e.instance.props.statusSections).map(section => [].concat(section).filter(entry => entry && entry.user && favorizedFriends.indexOf(entry.user.id) > -1));
}
@ -309,13 +306,6 @@ module.exports = (_ => {
return newSection;
});
}
if (e.returnvalue && !e.instance.props.statusSections.flat(10).length) e.returnvalue.props.children = BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.peopleslistempty,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FriendsEmptyState, {
type: !currentSection || !Object.entries(BDFDB.DiscordConstants.FriendsSections).find(n => n[1] == currentSection) ? BDFDB.DiscordConstants.FriendsSections.ALL : currentSection
})
});
}
processPeopleList (e) {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {filter: n => n && n.props && n.props.title && n.props.id});