From 52fb6c0d1b470a8bad1f724b46f5d0ad35943dff Mon Sep 17 00:00:00 2001 From: Joshua Kiwiet-Pantaleoni Date: Tue, 12 Oct 2021 15:45:05 -0700 Subject: [PATCH] feat: keep error and warning tip messages visible VUE-727 --- src/components/WwwFrame/TheTipMessage.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/WwwFrame/TheTipMessage.vue b/src/components/WwwFrame/TheTipMessage.vue index c8528bd308..d51e00cd9a 100644 --- a/src/components/WwwFrame/TheTipMessage.vue +++ b/src/components/WwwFrame/TheTipMessage.vue @@ -31,7 +31,7 @@ export default { this.messageType = data?.tip?.type ?? ''; this.persist = data?.tip?.persist ?? false; - this.$refs.tip.show(this.safeMessage, this.messageType, this.persist); + this.$refs.tip.show(this.safeMessage, this.messageType, this.preventAutoDismiss); this.initialPath = this.$route.path; } else { this.$refs.tip.close(); @@ -47,6 +47,11 @@ export default { initialPath: null }; }, + computed: { + preventAutoDismiss() { + return this.persist || this.messageType === 'error' || this.messageType === 'warning'; + } + }, watch: { /* Observe $route.path for changes @@ -59,7 +64,7 @@ export default { if (to !== this.initialPath && this.persist !== true) { this.$refs.tip.close(); } else if (to === this.initialPath) { - this.$refs.tip.show(this.safeMessage, this.messageType, this.persist); + this.$refs.tip.show(this.safeMessage, this.messageType, this.preventAutoDismiss); } }, }