show non-fatal setup errors on home screen instead of in popup
This commit is contained in:
@ -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>
|
||||
|
@ -8,6 +8,7 @@ export let appState = writable({
|
||||
currentRequest: null,
|
||||
pendingRequests: queue(),
|
||||
credentialStatus: 'locked',
|
||||
setupErrors: [],
|
||||
});
|
||||
|
||||
|
||||
|
@ -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}
|
Reference in New Issue
Block a user