Update 0BDFDB.plugin.js
This commit is contained in:
parent
56403017f8
commit
775673c433
|
@ -2,7 +2,7 @@
|
||||||
* @name BDFDB
|
* @name BDFDB
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 3.7.1
|
* @version 3.7.2
|
||||||
* @description Required Library for DevilBro's Plugins
|
* @description Required Library for DevilBro's Plugins
|
||||||
* @invite Jx3TjNS
|
* @invite Jx3TjNS
|
||||||
* @donate https://www.paypal.me/MircoWittrien
|
* @donate https://www.paypal.me/MircoWittrien
|
||||||
|
@ -4416,21 +4416,15 @@ module.exports = (_ => {
|
||||||
let LayersProviderIns = BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.layers), {name: "LayersProvider", unlimited: true, up: true});
|
let LayersProviderIns = BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.layers), {name: "LayersProvider", unlimited: true, up: true});
|
||||||
let LayersProviderType = LayersProviderIns && BDFDB.ObjectUtils.get(LayersProviderIns, `${BDFDB.ReactUtils.instanceKey}.type`);
|
let LayersProviderType = LayersProviderIns && BDFDB.ObjectUtils.get(LayersProviderIns, `${BDFDB.ReactUtils.instanceKey}.type`);
|
||||||
if (!LayersProviderType) return;
|
if (!LayersProviderType) return;
|
||||||
let parentSelector = "", notices = document.querySelector("#bd-notices");
|
let notices = document.querySelector("#bd-notices:has(#outdated-plugins)");
|
||||||
if (notices) {
|
|
||||||
let parentClasses = []
|
|
||||||
for (let i = 0, parent = notices.parentElement; i < 3; i++, parent = parent.parentElement) parentClasses.push(parent.className);
|
|
||||||
parentSelector = parentClasses.reverse().map(n => !n ? "*" : `.${n.split(" ").join(".")}`).join(" > ");
|
|
||||||
}
|
|
||||||
BDFDB.PatchUtils.patch({name: "BDFDB DiscordUtils"}, LayersProviderType.prototype, "render", {after: e => {
|
BDFDB.PatchUtils.patch({name: "BDFDB DiscordUtils"}, LayersProviderType.prototype, "render", {after: e => {
|
||||||
e.returnValue = BDFDB.ReactUtils.createElement(LayersProviderType, LayersProviderIns.props);
|
e.returnValue = BDFDB.ReactUtils.createElement(LayersProviderType, LayersProviderIns.props);
|
||||||
BDFDB.ReactUtils.forceUpdate(LayersProviderIns);
|
BDFDB.ReactUtils.forceUpdate(LayersProviderIns);
|
||||||
if (parentSelector) BDFDB.TimeUtils.timeout(_ => {
|
if (notices) BDFDB.TimeUtils.timeout(_ => {if (!document.contains(notices)) {
|
||||||
if (!document.contains(notices)) {
|
let ZeresPluginLibrary = BDFDB.BDUtils.getPlugin("ZeresPluginLibrary");
|
||||||
let parent = document.querySelector(parentSelector) || document.querySelector(BDFDB.dotCN.app).parentElement;
|
let updateChecker = ZeresPluginLibrary && ZeresPluginLibrary?.Library?.PluginUpdater?.checkAllPlugins;
|
||||||
if (parent) parent.insertBefore(notices, parent.firstElementChild);
|
if (typeof updateChecker == "function") updateChecker.apply(ZeresPluginLibrary.Library.PluginUpdater);
|
||||||
}
|
}}, 1000);
|
||||||
}, 1000);
|
|
||||||
}}, {once: true});
|
}}, {once: true});
|
||||||
BDFDB.ReactUtils.forceUpdate(LayersProviderIns);
|
BDFDB.ReactUtils.forceUpdate(LayersProviderIns);
|
||||||
}, instant ? 0 : 1000);
|
}, instant ? 0 : 1000);
|
||||||
|
|
Loading…
Reference in New Issue