Forgot to do social patch

This commit is contained in:
Zack Rauen 2020-02-08 01:10:08 -05:00
parent 7724c80da7
commit c07e8f38de
2 changed files with 21 additions and 6 deletions

View File

@ -2607,20 +2607,35 @@ class V2 {
this.socialPatch = BdApi.monkeyPatch(TabBar.prototype, "render", {after: (data) => { this.socialPatch = BdApi.monkeyPatch(TabBar.prototype, "render", {after: (data) => {
const children = data.returnValue.props.children; const children = data.returnValue.props.children;
if (!children || !children.length) return; if (!children || !children.length) return;
if (children[children.length - 2].type.displayName !== "Separator") return; if (children[children.length - 3].type.displayName !== "Separator") return;
if (!children[children.length - 1].type.toString().includes("socialLinks")) return; if (!children[children.length - 2].type.toString().includes("socialLinks")) return;
const original = children[children.length - 1].type; const original = children[children.length - 2].type;
const newOne = function() { const newOne = function() {
const returnVal = original(...arguments); const returnVal = original(...arguments);
returnVal.props.children.push(BdApi.React.createElement(Anchor, {className: "bd-social-link", href: "https://github.com/rauenzi/BetterDiscordApp", rel: "author", title: "BandagedBD", target: "_blank"}, returnVal.props.children.push(BdApi.React.createElement(Anchor, {className: "bd-social-link", href: "https://github.com/rauenzi/BetterDiscordApp", title: "BandagedBD", target: "_blank"},
BdApi.React.createElement(BDLogo, {size: "16px", className: "bd-social-logo"}) BdApi.React.createElement(BDLogo, {size: "16px", className: "bd-social-logo"})
)); ));
return returnVal; return returnVal;
}; };
children[children.length - 1].type = newOne; children[children.length - 2].type = newOne;
const BBDLink = BdApi.React.createElement(Anchor, {className: "bd-social-link", href: "https://twitter.com/BandagedBD", title: "BandagedBD", target: "_blank"}, "BandagedBD");
const AuthorLink = BdApi.React.createElement(Anchor, {className: "bd-social-link", href: "https://twitter.com/ZackRauen", title: "Zerebos", target: "_blank"}, "Zerebos");
const additional = BDV2.react.createElement("div", {className: "colorMuted-HdFt4q size12-3cLvbJ"}, [BBDLink, ` ${bbdVersion} by `, AuthorLink]);
const originalVersions = children[children.length - 1].type;
children[children.length - 1].type = function() {
const returnVal = originalVersions(...arguments);
console.log(returnVal);
returnVal.props.children.push(additional);
return returnVal;
};
}}); }});
} }
patchGuildListItems() { patchGuildListItems() {
if (this.guildListItemsPatch) return; if (this.guildListItemsPatch) return;
const listItemClass = this.guildClasses.listItem.split(" ")[0]; const listItemClass = this.guildClasses.listItem.split(" ")[0];

2
js/main.min.js vendored

File diff suppressed because one or more lines are too long