AppsView: updateInfo is now part of app object

This commit is contained in:
Girish Ramakrishnan
2025-06-26 16:37:51 +02:00
parent 19c9d7d59d
commit 2486aee24d
6 changed files with 26 additions and 33 deletions
+5 -10
View File
@@ -37,21 +37,16 @@ async function onAutoUpdatesEnabledChange(value) {
}
async function refreshUpdates() {
const [error, result] = await updaterModel.info();
const [error, result] = await updaterModel.checkAppUpdate(props.app.id);
if (error) return console.error(error);
const appUpdate = result[props.app.id] || null;
if (!appUpdate) update.value = null;
else if (!appUpdate.manifest) update.value = null;
else if (!appUpdate.manifest.version) update.value = null;
else if (appUpdate.manifest.version === props.app.manifest.version) update.value = null;
else update.value = appUpdate;
update.value = result;
}
async function onCheck() {
busyCheck.value = true;
const [error] = await appsModel.checkForUpdates(props.app.id);
const [error] = await appsModel.checkUpdate(props.app.id);
if (error) return console.error(error);
await refreshUpdates();
@@ -74,7 +69,7 @@ async function onUpdate() {
dialog.value.close();
[error] = await appsModel.checkForUpdates(props.app.id);
[error] = await appsModel.checkUpdate(props.app.id);
if (error) return console.error(error);
}
@@ -91,7 +86,7 @@ onMounted(async () => {
busyUpdate.value = false;
busyCheck.value = false;
autoUpdatesEnabled.value = props.app.enableAutomaticUpdate;
await refreshUpdates();
update.value = props.app.updateInfo;
const [error, result] = await profileModel.get();
if (error) return console.error(error);