Skip to content

Commit

Permalink
Merge pull request #3324 from kiva/VUE-727
Browse files Browse the repository at this point in the history
feat: keep error and warning tip messages visible VUE-727
  • Loading branch information
emuvente authored Oct 13, 2021
2 parents 7d01571 + 52fb6c0 commit c0b4a88
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/WwwFrame/TheTipMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
Expand All @@ -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);
}
},
}
Expand Down

0 comments on commit c0b4a88

Please sign in to comment.