show non-fatal setup errors on home screen instead of in popup

This commit is contained in:
Joseph Montanaro
2023-09-14 15:04:25 -07:00
parent 12f0f187a6
commit 992d2a4d06
11 changed files with 62 additions and 12 deletions

View File

@ -28,7 +28,12 @@ listen('launch-terminal-request', async (tauriEvent) => {
// else, session is unlocked, so do nothing
// (although we shouldn't even get the event in that case)
}
})
});
invoke('get_setup_errors')
.then(errs => {
$appState.setupErrors = errs.map(e => ({msg: e, show: true}));
});
acceptRequest();
</script>

View File

@ -8,6 +8,7 @@ export let appState = writable({
currentRequest: null,
pendingRequests: queue(),
credentialStatus: 'locked',
setupErrors: [],
});

View File

@ -51,4 +51,17 @@
{/if}
{/await}
</div>
</div>
</div>
{#if $appState.setupErrors.some(e => e.show)}
<div class="toast">
{#each $appState.setupErrors as error}
{#if error.show}
<div class="alert alert-error shadow-lg">
{error.msg}
<button class="btn btn-sm btn-alert-error" on:click={() => error.show = false}>Ok</button>
</div>
{/if}
{/each}
</div>
{/if}