From 7b00e3d301b0750e6bdd652495d0a9307e42a68d Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Wed, 3 Feb 2021 11:20:50 +0100 Subject: [PATCH] Update 0BDFDB.plugin.js --- Library/0BDFDB.plugin.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Library/0BDFDB.plugin.js b/Library/0BDFDB.plugin.js index f44074aef5..a73cd0d8d8 100644 --- a/Library/0BDFDB.plugin.js +++ b/Library/0BDFDB.plugin.js @@ -600,7 +600,7 @@ module.exports = (_ => { let newName = (body.match(/"name"\s*:\s*"([^"]+)"/) || [])[1] || pluginName; let newVersion = (body.match(/['"][0-9]+\.[0-9]+\.[0-9]+['"]/i) || "").toString().replace(/['"]/g, ""); if (!newVersion) return callback(null); - if (pluginName == newName && BDFDB.NumberUtils.getVersionDifference(newVersion[0], window.PluginUpdates.plugins[url].version) > 0.2) { + if (pluginName == newName && BDFDB.NumberUtils.getVersionDifference(newVersion, window.PluginUpdates.plugins[url].version) > 0.2) { BDFDB.NotificationUtils.toast(BDFDB.LanguageUtils.LibraryStringsFormat("toast_plugin_force_updated", pluginName), { type: "warning", disableInteractions: true @@ -608,7 +608,7 @@ module.exports = (_ => { BDFDB.PluginUtils.downloadUpdate(pluginName, url); return callback(2); } - else if (BDFDB.NumberUtils.compareVersions(newVersion[0], window.PluginUpdates.plugins[url].version)) { + else if (BDFDB.NumberUtils.compareVersions(newVersion, window.PluginUpdates.plugins[url].version)) { window.PluginUpdates.plugins[url].outdated = true; BDFDB.PluginUtils.showUpdateNotice(pluginName, url); return callback(1); @@ -654,9 +654,12 @@ module.exports = (_ => { type: "info", textClassName: BDFDB.disCN.noticeupdatetext, html: true, - btn: !BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.automaticLoading) ? BDFDB.LanguageUtils.LanguageStrings.ERRORS_RELOAD : "", forceStyle: true, customIcon: ``, + buttons: !BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.automaticLoading) && [{ + contents: BDFDB.LanguageUtils.LanguageStrings.ERRORS_RELOAD, + onClick: location.reload + }], onClose: _ => {vanishObserver.disconnect();} }); updateNotice.style.setProperty("z-index", "100000", "important"); @@ -667,7 +670,6 @@ module.exports = (_ => { let reloadButton = updateNotice.querySelector(BDFDB.dotCN.noticebutton); if (reloadButton) { BDFDB.DOMUtils.toggle(reloadButton, true); - reloadButton.addEventListener("click", location.reload); reloadButton.addEventListener("mouseenter", _ => { if (window.PluginUpdates.downloaded) BDFDB.TooltipUtils.create(reloadButton, window.PluginUpdates.downloaded.join(", "), { type: "bottom",