From 3118d5eb3d38d293ff104b6d347650d16e5cefa2 Mon Sep 17 00:00:00 2001 From: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com> Date: Thu, 27 Jul 2023 15:21:03 -0400 Subject: [PATCH] Simplify showing and hiding snackbar message --- photon-client/src/stores/StateStore.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/photon-client/src/stores/StateStore.ts b/photon-client/src/stores/StateStore.ts index 862fee0991..f58a30cc7a 100644 --- a/photon-client/src/stores/StateStore.ts +++ b/photon-client/src/stores/StateStore.ts @@ -109,24 +109,16 @@ export const useStateStore = defineStore("state", { }; }, showSnackbarMessage(data: { - show?: boolean, message: string, color: string, timeout?: number }) { this.snackbarData = { - show: data.show || true, + show: true, message: data.message, color: data.color, timeout: data.timeout || 2000 }; - - if(data.timeout != -1) { - setTimeout(this.hideSnackbarMessage, data.timeout || 2000); - } - }, - hideSnackbarMessage() { - this.snackbarData = { show: false, timeout: 0, color: "error", message: "" }; } } });