This commit is contained in:
Mirco Wittrien 2022-04-06 18:07:40 +02:00
parent 048d0eb6cb
commit 7e3df688b1
3 changed files with 9 additions and 3 deletions

View File

@ -370,7 +370,9 @@ module.exports = (_ => {
BDFDB.LibraryRequires.electron.clipboard.write({text: text});
BDFDB.NotificationUtils.toast(this.labels.toast_quotecopied, {type: "success"});
}
else BDFDB.LibraryModules.DispatchUtils.ComponentDispatch.dispatchToLastSubscribed(BDFDB.DiscordConstants.ComponentActions.INSERT_TEXT, {plainText: [this.settings.general.autoAddNewLine && ChannelTextAreaForm && ChannelTextAreaForm.state.textValue && !this.isNewLine(ChannelTextAreaForm.state.textValue, true) && !this.isNewLine(text, false) && "\n", text, this.settings.general.autoAddNewLine && !this.isNewLine(text, true) && "\n"].filter(n => n).join("")});
else BDFDB.LibraryModules.DispatchUtils.ComponentDispatch.dispatchToLastSubscribed(BDFDB.DiscordConstants.ComponentActions.INSERT_TEXT, {
plainText: [this.settings.general.autoAddNewLine && ChannelTextAreaForm && ChannelTextAreaForm.state.textValue && !this.isNewLine(ChannelTextAreaForm.state.textValue, true) && !this.isNewLine(text, false) && "\n", text, this.settings.general.autoAddNewLine && !this.isNewLine(text, true) && "\n"].filter(n => n).join("")
});
}
}

View File

@ -1050,6 +1050,7 @@ module.exports = (_ => {
};
BDFDB.ReactUtils.forceUpdate(e.instance);
}).then(result => {
if (!viewedImage) return;
let messages = [], index = -1;
if (result) {
messages = result.body.messages.flat(10).reverse();
@ -1414,7 +1415,7 @@ module.exports = (_ => {
min_id: (BigInt(cachedImages.newestId) - BigInt(1)).toString()
})
}).then(result => {
if (result) {
if (result && viewedImage) {
const messages = result.body.messages.flat(10).reverse();
const newCachedImages = this.filterMessagesForImages(messages, viewedImage);
const lastOldIndex = this.getImageIndex(newCachedImages, cachedImages.all[cachedImages.all.length-1]);
@ -1444,7 +1445,7 @@ module.exports = (_ => {
max_id: (BigInt(cachedImages.oldestId) + BigInt(1)).toString()
})
}).then(result => {
if (result) {
if (result && viewedImage) {
const messages = result.body.messages.flat(10).reverse();
const newCachedImages = this.filterMessagesForImages(messages, viewedImage);
const firstOldIndex = this.getImageIndex(newCachedImages, cachedImages.all[0]);

View File

@ -369,6 +369,9 @@
background-color: rgb(var(--accentcolor));
color: #fff;
}
.selectedVoid-3Kr388 {
background-color: rgb(var(--accentcolor));
}
.reactionMe-3I9gFK .reactionCount-1zkLcN, /* reaction count me */
.reactionMe-3I9gFK:hover .reactionCount-1zkLcN {