fix: conditions for checking updates
This commit is contained in:
parent
85261c0b08
commit
0526cfbb2a
2 changed files with 4 additions and 10 deletions
|
@ -121,11 +121,8 @@ os.api("admin/abuse-user-reports", {
|
||||||
|
|
||||||
if (defaultStore.state.showAdminUpdates) {
|
if (defaultStore.state.showAdminUpdates) {
|
||||||
os.api("latest-version").then((res) => {
|
os.api("latest-version").then((res) => {
|
||||||
const cleanRes = parseInt(res?.tag_name.replace(/[^0-9]/g, ""));
|
if (res == null || res.tag_name == null) return;
|
||||||
const cleanVersion = parseInt(version.replace(/[^0-9]/g, ""));
|
updateAvailable.value = !version.startsWith(res.tag_name);
|
||||||
if (cleanRes > cleanVersion) {
|
|
||||||
updateAvailable.value = true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -215,11 +215,8 @@ if ($i?.isAdmin) {
|
||||||
|
|
||||||
if (defaultStore.state.showAdminUpdates) {
|
if (defaultStore.state.showAdminUpdates) {
|
||||||
os.api("latest-version").then((res) => {
|
os.api("latest-version").then((res) => {
|
||||||
const cleanRes = parseInt(res?.tag_name.replace(/[^0-9]/g, ""));
|
if (res == null || res.tag_name == null) return;
|
||||||
const cleanVersion = parseInt(version.replace(/[^0-9]/g, ""));
|
updateAvailable.value = !version.startsWith(res.tag_name);
|
||||||
if (cleanRes > cleanVersion) {
|
|
||||||
updateAvailable.value = true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue