Skip to content

Commit

Permalink
fix: acting like stanza installation failure was a success
Browse files Browse the repository at this point in the history
  • Loading branch information
BrewingWeasel committed Aug 18, 2024
1 parent fab1bbe commit 3bb85b1
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/components/EnableStanza.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,20 @@ const enabled = defineModel<boolean>("enabled", { required: true });
const installMessage = ref("Downloading...");
const finishedInstall = ref(false);
const errored = ref(false);
await listen<{ message: string }>("stanzaDownloadUpdate", (event) => {
installMessage.value = event.payload.message;
});
async function installStanza() {
await invoke("setup_stanza").catch((e) => {
toast.error(e);
errored.value = true;
});
installMessage.value = "Installation complete.";
installMessage.value = errored.value
? "Installation failed."
: "Installation complete.";
finishedInstall.value = true;
}
</script>
Expand All @@ -55,8 +60,10 @@ async function installStanza() {
<AlertDialogFooter>
<AlertDialogAction
@click="
isInstalled = true;
enabled = true;
if (!errored) {
isInstalled = true;
enabled = true;
}
"
v-if="finishedInstall"
>Continue</AlertDialogAction
Expand Down

0 comments on commit 3bb85b1

Please sign in to comment.