AppsView: updateInfo is now part of app object
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user