From c59893ad21d32f20f65d7de8856e4e0590cdadd5 Mon Sep 17 00:00:00 2001 From: Gabriel Pastori <58153955+gabrielpastori1@users.noreply.github.com> Date: Fri, 17 Nov 2023 16:55:45 -0300 Subject: [PATCH] Refactor loading state in Home.vue --- src/views/Home.vue | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/views/Home.vue b/src/views/Home.vue index fa73d09..e69ec85 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -26,11 +26,7 @@ - + {{ loading ? "Carregando..." : "Nenhuma instância encontrada" }} @@ -122,7 +118,7 @@ export default { }, data: () => ({ AppStore: useAppStore(), - loading: false, + loadingInner: false, loadingDelete: false, error: false, statusMapper: statusMapper, @@ -163,17 +159,22 @@ export default { }, async getInstances() { try { - this.loading = true; + this.loadingInner = true; this.instances = await this.AppStore.reconnect(); } catch (e) { this.error = e.message?.message || e.message || e; } finally { - this.loading = false; + this.loadingInner = false; } }, }, watch: {}, computed: { + loading() { + debugger; + return this.loadingInner || this.AppStore.connecting; + }, + instances() { return this.AppStore.instances; },