fix: 🐛 better update detection logic

This commit is contained in:
ThatOneCalculator 2023-01-10 08:58:24 -08:00
parent 83fe5ca701
commit 8a8e7be076
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
2 changed files with 6 additions and 6 deletions

View File

@ -72,9 +72,9 @@ os.api('admin/abuse-user-reports', {
if (defaultStore.state.showAdminUpdates) {
os.api('latest-version').then(res => {
const cleanRes = res?.tag_name.replace(/[^0-9]/g, '');
const cleanVersion = version.replace(/[^0-9]/g, '');
if (cleanRes !== cleanVersion) {
const cleanRes = parseInt(res?.tag_name.replace(/[^0-9]/g, ''));
const cleanVersion = parseInt(version.replace(/[^0-9]/g, ''));
if (cleanRes > cleanVersion) {
updateAvailable = true;
}
});

View File

@ -108,9 +108,9 @@ if ($i?.isAdmin) {
if (defaultStore.state.showAdminUpdates) {
os.api('latest-version').then(res => {
const cleanRes = res?.tag_name.replace(/[^0-9]/g, '');
const cleanVersion = version.replace(/[^0-9]/g, '');
if (cleanRes !== cleanVersion) {
const cleanRes = parseInt(res?.tag_name.replace(/[^0-9]/g, ''));
const cleanVersion = parseInt(version.replace(/[^0-9]/g, ''));
if (cleanRes > cleanVersion) {
updateAvailable = true;
}
});