sane default for notice timeout
This commit is contained in:
parent
7f42e0e5a7
commit
589889ad31
1 changed files with 2 additions and 2 deletions
|
|
@ -205,7 +205,7 @@ export const useInterfaceStore = defineStore('interface', {
|
||||||
messageKey,
|
messageKey,
|
||||||
messageArgs = {},
|
messageArgs = {},
|
||||||
level = 'error',
|
level = 'error',
|
||||||
timeout = 0,
|
timeout = 5000,
|
||||||
}) {
|
}) {
|
||||||
const notice = {
|
const notice = {
|
||||||
messageKey,
|
messageKey,
|
||||||
|
|
@ -218,7 +218,7 @@ export const useInterfaceStore = defineStore('interface', {
|
||||||
// Adding a new element to array wraps it in a Proxy, which breaks the comparison
|
// Adding a new element to array wraps it in a Proxy, which breaks the comparison
|
||||||
// TODO: Generate UUID or something instead or relying on !== operator?
|
// TODO: Generate UUID or something instead or relying on !== operator?
|
||||||
const newNotice = this.globalNotices[this.globalNotices.length - 1]
|
const newNotice = this.globalNotices[this.globalNotices.length - 1]
|
||||||
if (timeout) {
|
if (timeout > 0) {
|
||||||
setTimeout(() => this.removeGlobalNotice(newNotice), timeout)
|
setTimeout(() => this.removeGlobalNotice(newNotice), timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue