Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion core/frontend/src/components/app/Alerter.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-snackbar
v-model="show"
timeout="-1"
:timeout="timeout"
>
{{ message }}

Expand Down Expand Up @@ -49,6 +49,17 @@ export default Vue.extend({
return 'info'
}
},
timeout(): number {
switch (this.level) {
case MessageLevel.Success:
case MessageLevel.Info:
return 5000
case MessageLevel.Warning:
return 7000
default:
return -1
Comment on lines +52 to +60
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Avoid magic numbers for timeouts by extracting named constants or documenting their intent.

Using raw 5000 and 7000 obscures their meaning (e.g., default vs. warning timeout). Please extract them into named constants (e.g., SUCCESS_INFO_TIMEOUT_MS, WARNING_TIMEOUT_MS) or a small MessageLevel-keyed map so the intent is clear and easier to adjust later.

}
},
},
mounted() {
message_manager.addCallback((level: MessageLevel, message: string) => {
Expand Down