Reducing usage of browser notifications in favor of in-app notifications

This commit is contained in:
James Barnsley
2018-02-23 09:35:38 +13:00
parent 2566c60a05
commit ac6e0eea0c
23 changed files with 1079 additions and 1001 deletions

View File

@ -175,20 +175,22 @@ export function createBrowserNotification(data){
}
}
export function createNotification(content, type = 'default', key = null, title = null, description = null, sticky = false){
if (!key){
key = helpers.generateGuid()
}
// content, type = 'default', key = null, title = null, description = null, sticky = false
export function createNotification(data){
return {
type: 'CREATE_NOTIFICATION',
notification: {
key: key,
type: type,
title: title,
description: description,
content: content,
sticky: sticky
}
notification: Object.assign(
{
key: helpers.generateGuid(),
type: 'default',
title: null,
content: null,
description: null,
sticky: false
},
data
)
}
}