Update PersonalPins.plugin.js
This commit is contained in:
parent
b7c3e58cc6
commit
e385385a1d
|
@ -155,7 +155,7 @@ class PersonalPins {
|
||||||
|
|
||||||
getDescription () {return "Similar to normal pins. Lets you save messages as notes for yourself.";}
|
getDescription () {return "Similar to normal pins. Lets you save messages as notes for yourself.";}
|
||||||
|
|
||||||
getVersion () {return "1.6.4";}
|
getVersion () {return "1.6.5";}
|
||||||
|
|
||||||
getAuthor () {return "DevilBro";}
|
getAuthor () {return "DevilBro";}
|
||||||
|
|
||||||
|
@ -297,7 +297,8 @@ class PersonalPins {
|
||||||
if (!wrapper.querySelector(".btn-pinitem-personalpins") && !wrapper.querySelector(".btn-unpinitem-personalpins")) {
|
if (!wrapper.querySelector(".btn-pinitem-personalpins") && !wrapper.querySelector(".btn-unpinitem-personalpins")) {
|
||||||
let pins = BDFDB.loadAllData(this, "pins");
|
let pins = BDFDB.loadAllData(this, "pins");
|
||||||
let channel = instance.props.channel;
|
let channel = instance.props.channel;
|
||||||
let {messagediv, pos} = this.getMessageAndPos(instance._reactInternalFiber.return.return.return.memoizedProps.target);
|
let target = instance.props.target || instance._reactInternalFiber.return.return.return.memoizedProps.target;
|
||||||
|
let {messagediv, pos} = this.getMessageAndPos(target);
|
||||||
if (!messagediv || pos == -1) return;
|
if (!messagediv || pos == -1) return;
|
||||||
if (pins[channel.guild_id] && pins[channel.guild_id][channel.id] && pins[channel.guild_id][channel.id][instance.props.message.id + "_" + pos]) {
|
if (pins[channel.guild_id] && pins[channel.guild_id][channel.id] && pins[channel.guild_id][channel.id][instance.props.message.id + "_" + pos]) {
|
||||||
$(this.popoutUnpinEntryMarkup)
|
$(this.popoutUnpinEntryMarkup)
|
||||||
|
@ -310,7 +311,7 @@ class PersonalPins {
|
||||||
else {
|
else {
|
||||||
$(this.popoutPinEntryMarkup)
|
$(this.popoutPinEntryMarkup)
|
||||||
.on("click." + this.getName(), () => {
|
.on("click." + this.getName(), () => {
|
||||||
this.addMessageToNotes(instance.props.message, instance._reactInternalFiber.return.return.return.memoizedProps.target, instance.props.channel);
|
this.addMessageToNotes(instance.props.message, target, instance.props.channel);
|
||||||
instance.props.onClose();
|
instance.props.onClose();
|
||||||
})
|
})
|
||||||
.appendTo(wrapper);
|
.appendTo(wrapper);
|
||||||
|
|
Loading…
Reference in New Issue