Update DisplayLargeMessages.plugin.js
This commit is contained in:
parent
4c43e5d02b
commit
785b6b4204
|
@ -219,36 +219,38 @@ var DisplayLargeMessages = (_ => {
|
|||
}
|
||||
|
||||
processAttachment (e) {
|
||||
if (e.instance.props.filename == "message.txt" && settings.onDemand || amounts.maxFileSize && (amounts.maxFileSize < e.instance.props.size/1024)) e.returnvalue.props.children.splice(2, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
|
||||
text: this.labels.button_injectattchment_text,
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Anchor, {
|
||||
rel: "noreferrer noopener",
|
||||
target: "_blank",
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
|
||||
className: BDFDB.disCN._displaylargemessagesinjectbutton,
|
||||
name: BDFDB.LibraryComponents.SvgIcon.Names.RAW_TEXT,
|
||||
width: 20,
|
||||
height: 20
|
||||
}),
|
||||
onClick: event => {
|
||||
BDFDB.ListenerUtils.stopEvent(event);
|
||||
let target = event.target;
|
||||
let message = BDFDB.ReactUtils.findValue(target, "message", {up: true});
|
||||
if (message) {
|
||||
pendingRequests.push(message.id);
|
||||
BDFDB.LibraryRequires.request(e.instance.props.url, (error, response, body) => {
|
||||
BDFDB.ArrayUtils.remove(pendingRequests, message.id, true);
|
||||
oldMessages[message.id] = new BDFDB.DiscordObjects.Message(message);
|
||||
encodedMessages[message.id] = {
|
||||
content: message.content || "",
|
||||
attachment: body || ""
|
||||
};
|
||||
BDFDB.ModuleUtils.forceAllUpdates(this, "Messages");
|
||||
});
|
||||
if (e.instance.props.filename == "message.txt" && (settings.onDemand || amounts.maxFileSize && (amounts.maxFileSize < e.instance.props.size/1024))) {
|
||||
e.returnvalue.props.children.splice(2, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
|
||||
text: this.labels.button_injectattchment_text,
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Anchor, {
|
||||
rel: "noreferrer noopener",
|
||||
target: "_blank",
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
|
||||
className: BDFDB.disCN._displaylargemessagesinjectbutton,
|
||||
name: BDFDB.LibraryComponents.SvgIcon.Names.RAW_TEXT,
|
||||
width: 20,
|
||||
height: 20
|
||||
}),
|
||||
onClick: event => {
|
||||
BDFDB.ListenerUtils.stopEvent(event);
|
||||
let target = event.target;
|
||||
let message = BDFDB.ReactUtils.findValue(target, "message", {up: true});
|
||||
if (message) {
|
||||
pendingRequests.push(message.id);
|
||||
BDFDB.LibraryRequires.request(e.instance.props.url, (error, response, body) => {
|
||||
BDFDB.ArrayUtils.remove(pendingRequests, message.id, true);
|
||||
oldMessages[message.id] = new BDFDB.DiscordObjects.Message(message);
|
||||
encodedMessages[message.id] = {
|
||||
content: message.content || "",
|
||||
attachment: body || ""
|
||||
};
|
||||
BDFDB.ModuleUtils.forceAllUpdates(this, "Messages");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}));
|
||||
})
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
forceUpdateAll () {
|
||||
|
|
Loading…
Reference in New Issue