Update UserNotes.plugin.js
This commit is contained in:
parent
5792b2d6a9
commit
5831603a66
|
@ -1,9 +1,10 @@
|
|||
//META{"name":"UserNotes","authorId":"278543574059057154","invite":"Jx3TjNS","donate":"https://www.paypal.me/MircoWittrien","patreon":"https://www.patreon.com/MircoWittrien","website":"https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/UserNotes","source":"https://raw.githubusercontent.com/mwittrien/BetterDiscordAddons/master/Plugins/UserNotes/UserNotes.plugin.js"}*//
|
||||
|
||||
class UserNotes {
|
||||
var UserNotes = (_ => {
|
||||
return class UserNotes {
|
||||
getName () {return "UserNotes";}
|
||||
|
||||
getVersion () {return "1.0.4";}
|
||||
getVersion () {return "1.0.5";}
|
||||
|
||||
getAuthor () {return "DevilBro";}
|
||||
|
||||
|
@ -11,7 +12,7 @@ class UserNotes {
|
|||
|
||||
constructor () {
|
||||
this.changelog = {
|
||||
"improved":[["New Library Structure & React","Restructured my Library and switched to React rendering instead of DOM manipulation"]]
|
||||
"fixed":[["Context Menu Update","Fixes for the context menu update, yaaaaaay"]]
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -88,20 +89,17 @@ class UserNotes {
|
|||
|
||||
onUserContextMenu (e) {
|
||||
if (e.instance.props.user) {
|
||||
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
|
||||
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItems.Group, {
|
||||
children: [
|
||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItems.Item, {
|
||||
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["id", "devmode-copy-id"]]});
|
||||
children.splice(index > -1 ? index : children.length, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
||||
label: BDFDB.LanguageUtils.LanguageStrings.USERS + " " + BDFDB.LanguageUtils.LanguageStrings.NOTE,
|
||||
id: BDFDB.ContextMenuUtils.createItemId(this.name, "user-note"),
|
||||
action: _ => {
|
||||
BDFDB.ContextMenuUtils.close(e.instance);
|
||||
this.openNotesModal(e.instance.props.user);
|
||||
}
|
||||
})
|
||||
]
|
||||
});
|
||||
if (index > -1) children.splice(index, 0, itemgroup);
|
||||
else children.push(itemgroup);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -132,4 +130,5 @@ class UserNotes {
|
|||
}]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
Loading…
Reference in New Issue