Skip to content
This repository was archived by the owner on Apr 16, 2025. It is now read-only.

Commit 65a401d

Browse files
committed
fix: update alerts
Update alerts were still using the old alert system. Now it uses the new one.
1 parent 77055ad commit 65a401d

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

utils/update_checker.php

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,9 @@ public static function getCurrentVersion(){
2424
}
2525

2626
public static function alertJs(){
27-
$arr = array(
28-
sprintf("An update is available (%s -> %s)", self::$version, self::$latestVer),
29-
sprintf("Please download it <a href=\'%s\'>HERE</a>", self::$downloadUrl),
30-
);
31-
32-
// Dynamically create a array string for the above array
33-
$jsArrayString = "[";
34-
foreach ($arr as $key => $value) {
35-
$jsArrayString .= "'%s'" . ($key == count($arr)-1 ? "" : ",");
36-
}
37-
$jsArrayString .= "]";
38-
39-
$jsArrayString = vsprintf($jsArrayString, $arr);
40-
41-
return "<script> createAlert('danger', 'Update available', " . $jsArrayString . "); </script>";
27+
$jsArrayString = sprintf("An update is available (%s -> %s). Please download it <a style=\'color: #000;\' href=\'%s\'>HERE.</a>", self::$version, self::$latestVer, self::$downloadUrl);
4228

29+
return "<script> createAlert({ title: 'Update available', message: '" . $jsArrayString . "'}, {type: 'danger', delay: 0}); </script>";
4330
}
4431
}
4532

0 commit comments

Comments
 (0)