Update BDFDB.js

This commit is contained in:
Mirco Wittrien 2020-01-31 20:29:02 +01:00
parent 29cdae46c2
commit 013a4203b4
1 changed files with 17 additions and 0 deletions

View File

@ -1966,6 +1966,23 @@
}
};
BDFDB.MessageUtils = {};
BDFDB.MessageUtils.rerenderAll = function () {
let MessagesIns = BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name:"Messages", unlimited:true});
let MessagesPrototype = BDFDB.ReactUtils.getValue(MessagesIns, "_reactInternalFiber.type.prototype");
if (MessagesIns && MessagesPrototype) {
let patchCancel = BDFDB.ModuleUtils.patch(BDFDB, MessagesPrototype, "render", {after:e => {
patchCancel();
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnValue, {props: ["message", "channel"]});
if (index > -1) {
for (let i in children) children[i] = null;
BDFDB.ReactUtils.forceUpdate(MessagesIns);
}
}});
BDFDB.ReactUtils.forceUpdate(MessagesIns);
}
};
BDFDB.UserUtils = {};
var myDataUser = LibraryModules.CurrentUserStore ? LibraryModules.CurrentUserStore.getCurrentUser() : null;
BDFDB.UserUtils.is = function (user) {