fix: 🐛 better update detection logic

This commit is contained in:
ThatOneCalculator 2023-01-10 08:58:24 -08:00
parent 50d9c8f07c
commit 37e3e34441
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;
}
});