Validate version number better

This commit is contained in:
Kainoa Kanter 2022-10-26 04:34:01 +02:00
parent 4c9dabe7b8
commit b5b5e80c10

View File

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