feat: less bad installations

This commit is contained in:
2025-02-23 20:54:47 +01:00
parent caead1e70f
commit 6236b8ef96
13 changed files with 124 additions and 58 deletions

View File

@ -13,7 +13,14 @@ const install = async () => {
return;
}
await invoke('install_package', { key: pkgKey(props.pkg) });
try {
await invoke('install_package', { key: pkgKey(props.pkg) });
} catch (err) {
console.error(err);
if (props.pkg !== undefined) {
props.pkg.js.busy = false;
}
}
//if (rv === 'Deferred') { /* download progress */ }
};
@ -39,7 +46,7 @@ const remove = async () => {
size="small"
class="self-center ml-4"
style="width: 2rem; height: 2rem"
:loading="false"
:loading="pkg?.js.busy"
v-on:click="remove()"
/>
@ -52,7 +59,7 @@ const remove = async () => {
size="small"
class="self-center ml-4"
style="width: 2rem; height: 2rem"
:loading="false"
:loading="pkg?.js.busy"
v-on:click="install()"
/>
</template>

View File

@ -13,8 +13,9 @@ const props = defineProps({
pkg: Object as () => Package,
});
const toggle = (value: boolean) => {
const toggle = async (value: boolean) => {
store.toggle(props.pkg, value);
await store.reloadProfile();
};
</script>