Update PinDMs.plugin.js

This commit is contained in:
Mirco Wittrien 2023-07-25 12:58:45 +02:00
parent aa7d5cab65
commit 507eb80514
1 changed files with 6 additions and 2 deletions

View File

@ -2,7 +2,7 @@
* @name PinDMs * @name PinDMs
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.9.8 * @version 1.9.9
* @description Allows you to pin DMs, making them appear at the top of your DMs/ServerList * @description Allows you to pin DMs, making them appear at the top of your DMs/ServerList
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -59,6 +59,8 @@ module.exports = (_ => {
var hoveredCategory, draggedCategory, releasedCategory; var hoveredCategory, draggedCategory, releasedCategory;
var hoveredChannel, draggedChannel, releasedChannel; var hoveredChannel, draggedChannel, releasedChannel;
var channelListIsRenderendering;
return class PinDMs extends Plugin { return class PinDMs extends Plugin {
onLoad () { onLoad () {
this.defaults = { this.defaults = {
@ -903,7 +905,9 @@ module.exports = (_ => {
updateContainer (type) { updateContainer (type) {
switch (type) { switch (type) {
case "channelList": case "channelList":
this.forceUpdateAll(); if (channelListIsRenderendering) BDFDB.DiscordUtils.rerenderAll(true);
channelListIsRenderendering = true;
BDFDB.TimeUtils.timeout(_ => channelListIsRenderendering = false, 3000);
break; break;
case "guildList": case "guildList":
BDFDB.DiscordUtils.rerenderAll(true); BDFDB.DiscordUtils.rerenderAll(true);