Skip to content

Commit

Permalink
vuestorefront#2307 added possibility to have sticky notifications (wi…
Browse files Browse the repository at this point in the history
…thout timeout)
  • Loading branch information
phoenixdev-kl committed Jan 31, 2019
1 parent 6bfe3f1 commit 19be955
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions core/modules/notification/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ export const module: Module<NotificationState, any> = {
return
}
commit('add', notification)
setTimeout(() => {
dispatch('removeNotification')
}, notification.timeToLive || 5000)
if (!notification.hasNoTimeout) {
setTimeout(() => {
dispatch('removeNotification')
}, notification.timeToLive || 5000)
}
},
removeNotification ({ commit, state }, index?: number) {
if (!index) {
Expand Down
3 changes: 2 additions & 1 deletion core/modules/notification/types/NotificationItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ export default interface NotificationItem {
message: string,
timeToLive?: number,
action1: ActionItem,
action2?: ActionItem
action2?: ActionItem,
hasNoTimeout?: boolean
}

0 comments on commit 19be955

Please sign in to comment.