From fb6fbd0dd7bc9fb2b2caf4eb6d5a03113f0eab30 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Thu, 1 Dec 2022 21:08:24 +0100 Subject: [PATCH] stuff --- Library/0BDFDB.plugin.js | 4 ++-- Plugins/ServerFolders/ServerFolders.plugin.js | 15 +++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Library/0BDFDB.plugin.js b/Library/0BDFDB.plugin.js index d2d746e8ce..814f1b89ca 100644 --- a/Library/0BDFDB.plugin.js +++ b/Library/0BDFDB.plugin.js @@ -2,7 +2,7 @@ * @name BDFDB * @author DevilBro * @authorId 278543574059057154 - * @version 3.0.0 + * @version 3.0.1 * @description Required Library for DevilBro's Plugins * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -5881,7 +5881,7 @@ module.exports = (_ => { onChange: e => { let file = e.currentTarget.files[0]; if (this.refInput && file && (!filter.length || filter.some(n => file.type.indexOf(n) == 0))) { - this.refInput.props.value = this.props.searchFolders ? file.path.split(file.name).slice(0, -1).join(file.name) : `${this.props.mode == "url" ? "url('" : ""}${(this.props.useFilePath) ? file.path : `data:${file.type};base64,${Internal.LibraryRequires.fs.readFileSync(file.path).toString("base64")}`}${this.props.mode ? "')" : ""}`; + this.refInput.props.value = this.props.searchFolders ? file.path.split(file.name).slice(0, -1).join(file.name) : `${this.props.mode == "url" ? "url('" : ""}${(this.props.useFilePath) ? file.path : `data:${file.type};base64,${Buffer.from(Internal.LibraryRequires.fs.readFileSync(file.path, "")).toString("base64")}`}${this.props.mode ? "')" : ""}`; BDFDB.ReactUtils.forceUpdate(this.refInput); this.refInput.handleChange(this.refInput.props.value); } diff --git a/Plugins/ServerFolders/ServerFolders.plugin.js b/Plugins/ServerFolders/ServerFolders.plugin.js index 6f253b4381..33b5c15683 100644 --- a/Plugins/ServerFolders/ServerFolders.plugin.js +++ b/Plugins/ServerFolders/ServerFolders.plugin.js @@ -2,7 +2,7 @@ * @name ServerFolders * @author DevilBro * @authorId 278543574059057154 - * @version 7.0.4 + * @version 7.0.5 * @description Changes Discord's Folders, Servers open in a new Container, also adds extra Features to more easily organize, customize and manage your Folders * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -301,9 +301,9 @@ module.exports = (_ => { BDFDB.TimeUtils.clear(this._previewInterval); } checkImage(base64OrUrl, callback) { - if (base64OrUrl.indexOf("https://") == 0 || base64OrUrl.indexOf("http://") == 0) BDFDB.LibraryRequires.request(base64OrUrl.trim(), {encoding: null}, (error, response, body) => { + if (base64OrUrl.indexOf("https://") == 0 || base64OrUrl.indexOf("http://") == 0) BDFDB.LibraryRequires.request(base64OrUrl.trim(), {agentOptions: {rejectUnauthorized: false}, headers: {"Content-Type": "application/json"}}, (error, response, body) => { if (response && response.headers["content-type"] && response.headers["content-type"].indexOf("image") != -1 && response.headers["content-type"] != "image/gif") { - this.resizeImage("data:" + response.headers["content-type"] + ";base64," + (new Buffer(body).toString("base64")), callback); + this.resizeImage("data:" + response.headers["content-type"] + ";base64," + Buffer.from(body).toString("base64"), callback); } else callback(base64OrUrl); }); @@ -635,10 +635,6 @@ module.exports = (_ => { }) })); } - } - - onGuildFolderContextMenu (e) { - if (document.querySelector(BDFDB.dotCN.modalwrapper)) return; if (e.instance.props.target && e.instance.props.folderId) { let folder = BDFDB.LibraryModules.SortedGuildUtils.getGuildFolderById(e.instance.props.folderId); let data = this.getFolderConfig(e.instance.props.folderId); @@ -1092,11 +1088,10 @@ module.exports = (_ => { className: BDFDB.disCNS.margintop4 + BDFDB.disCN.marginbottom4 }), BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ListRow, { - prefix: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildComponents.Guild, { + prefix: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildIconComponents.Icon, { className: BDFDB.disCN.listavatar, guild: guild, - menu: false, - tooltip: false + size: BDFDB.LibraryComponents.GuildIconComponents.Icon.Sizes.MEDIUM }), label: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextScroller, { children: guild.name