finished login form validation and self-destroying notifications
This commit is contained in:
@@ -14,7 +14,7 @@ export const useNotifications = defineStore('notifications', {
|
||||
this.notifications.delete(id)
|
||||
},
|
||||
|
||||
add(type : string, text: string) : void {
|
||||
add(type : string, text: string, timeout: number = 1000) : void {
|
||||
const id = uuidv4()
|
||||
this.notifications.set(
|
||||
id,
|
||||
@@ -23,7 +23,7 @@ export const useNotifications = defineStore('notifications', {
|
||||
text:text,
|
||||
}
|
||||
)
|
||||
setTimeout(() => this.remove(id), 1500)
|
||||
if (timeout !== -1) setTimeout(() => this.remove(id), timeout)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user