Adding a reconnect feature in case first Pusher request fails

Now, if the first pusher request fails, a waiting message will be displayed and the application will reconnect when the pusher comes back alive or the network connection is established again.
This commit is contained in:
David Négrier 2021-11-29 18:15:21 +01:00
parent 9eb4206fe0
commit fcf0888864
17 changed files with 981 additions and 32 deletions

View file

@ -1,8 +1,8 @@
<script lang="ts">
import {errorStore} from "../../Stores/ErrorStore";
import {errorStore, hasClosableMessagesInErrorStore} from "../../Stores/ErrorStore";
function close(): boolean {
errorStore.clearMessages();
errorStore.clearClosableMessages();
return false;
}
@ -12,12 +12,14 @@ function close(): boolean {
<p class="nes-text is-error title">Error</p>
<div class="body">
{#each $errorStore as error}
<p>{error}</p>
<p>{error.message}</p>
{/each}
</div>
{#if $hasClosableMessagesInErrorStore}
<div class="button-bar">
<button class="nes-btn is-error" on:click={close}>Close</button>
</div>
{/if}
</div>
<style lang="scss">