Bug fix, the new version is not showing up

This commit is contained in:
Diego Najar 2022-09-08 21:35:15 +02:00
parent e5a7735360
commit 600724da2b
2 changed files with 6 additions and 4 deletions

View file

@ -8,10 +8,12 @@ function getLatestVersion() {
method: "GET",
dataType: 'json',
success: function(json) {
console.log("[INFO] [PLUGIN VERSION] Request completed.");
// Constant BLUDIT_BUILD is defined on variables.js
if (json.stable.build > BLUDIT_BUILD) {
$("#current-version").hide();
$("#new-version").show();
$(".current-version").hide();
$(".new-version").show();
}
},
error: function(json) {

View file

@ -42,10 +42,10 @@ class pluginVersion extends Plugin {
global $L;
$html = '';
if ($this->getValue('showCurrentVersion')) {
$html = '<a id="current-version" class="nav-link" href="'.HTML_PATH_ADMIN_ROOT.'about'.'">'.$L->get('Version').' '.(defined('BLUDIT_PRO')?'<span class="fa fa-heart" style="color: #ffc107"></span>':'').'<span class="badge badge-warning badge-pill">'.BLUDIT_VERSION.'</span></a>';
$html = '<a class="current-version" class="nav-link" href="'.HTML_PATH_ADMIN_ROOT.'about'.'"><span class="fa fa-info"></span> '.$L->get('Version').' '.(defined('BLUDIT_PRO')?'<span class="fa fa-heart" style="color: #ffc107"></span>':'').'<span class="badge badge-warning badge-pill">'.BLUDIT_VERSION.'</span></a>';
}
if ($this->getValue('newVersionAlert')) {
$html .= '<a id="new-version" style="display: none;" target="_blank" href="https://www.bludit.com">'.$L->get('New version available').' <span class="fa fa-bell" style="color: red"></span></a>';
$html .= '<a class="new-version" style="display: none;" target="_blank" href="https://www.bludit.com"><span class="fa fa-bell" style="color: red"></span> '.$L->get('New version available').'</a>';
}
return $html;
}