This commit is contained in:
Mirco Wittrien 2021-05-22 16:56:13 +02:00
parent 837a929f7c
commit d4c721d9dd
2 changed files with 9 additions and 11 deletions

View File

@ -2455,6 +2455,9 @@
"messagespopoutbottom": ["MessagesPopout", "bottom"], "messagespopoutbottom": ["MessagesPopout", "bottom"],
"messagespopoutbutton": ["MessagesPopoutButtons", "button"], "messagespopoutbutton": ["MessagesPopoutButtons", "button"],
"messagespopoutbuttonsecondary": ["MessagesPopoutButtons", "secondary"], "messagespopoutbuttonsecondary": ["MessagesPopoutButtons", "secondary"],
"messagespopoutbuttonsize24": ["MessagesPopoutButtons", "size24"],
"messagespopoutbuttonsize32": ["MessagesPopoutButtons", "size32"],
"messagespopoutbuttonsize36": ["MessagesPopoutButtons", "size36"],
"messagespopoutbuttontertiary": ["MessagesPopoutButtons", "tertiary"], "messagespopoutbuttontertiary": ["MessagesPopoutButtons", "tertiary"],
"messagespopoutchannelname": ["MessagesPopout", "channelName"], "messagespopoutchannelname": ["MessagesPopout", "channelName"],
"messagespopoutchannelseparator": ["MessagesPopout", "channelSeparator"], "messagespopoutchannelseparator": ["MessagesPopout", "channelSeparator"],

View File

@ -2,7 +2,7 @@
* @name ReadAllNotificationsButton * @name ReadAllNotificationsButton
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.6.7 * @version 1.6.8
* @description Adds a Clear Button to the Server List and the Mentions Popout * @description Adds a Clear Button to the Server List and the Mentions Popout
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -17,13 +17,8 @@ module.exports = (_ => {
"info": { "info": {
"name": "ReadAllNotificationsButton", "name": "ReadAllNotificationsButton",
"author": "DevilBro", "author": "DevilBro",
"version": "1.6.7", "version": "1.6.8",
"description": "Adds a Clear Button to the Server List and the Mentions Popout" "description": "Adds a Clear Button to the Server List and the Mentions Popout"
},
"changeLog": {
"improved": {
"Canary Changes": "Preparing Plugins for the changes that are already done on Discord Canary"
}
} }
}; };
@ -294,14 +289,14 @@ module.exports = (_ => {
let childrenRender = tree.props.children; let childrenRender = tree.props.children;
tree.props.children = (...args) => { tree.props.children = (...args) => {
let children = childrenRender(...args); let children = childrenRender(...args);
this.injectButton(children); this.handleGuilds(children);
return children; return children;
}; };
} }
else this.injectButton(returnvalue); else this.handleGuilds(returnvalue);
} }
injectButton (returnvalue) { handleGuilds (returnvalue) {
let [children, index] = BDFDB.ReactUtils.findParent(returnvalue, {name: "ConnectedUnreadDMs"}); let [children, index] = BDFDB.ReactUtils.findParent(returnvalue, {name: "ConnectedUnreadDMs"});
if (index > -1) children.splice(index + 1, 0, BDFDB.ReactUtils.createElement(ReadAllButtonComponent, {})); if (index > -1) children.splice(index + 1, 0, BDFDB.ReactUtils.createElement(ReadAllButtonComponent, {}));
} }
@ -315,7 +310,7 @@ module.exports = (_ => {
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})`,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, { children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
className: BDFDB.disCNS.messagespopoutbutton + BDFDB.disCN.messagespopoutbuttonsecondary, className: BDFDB.disCNS.messagespopoutbutton + BDFDB.disCNS.messagespopoutbuttonsecondary + BDFDB.disCN.messagespopoutbuttonsize32,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, { children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
nativeClass: true, nativeClass: true,
name: BDFDB.LibraryComponents.SvgIcon.Names.CLOSE, name: BDFDB.LibraryComponents.SvgIcon.Names.CLOSE,