Transform old notification payload shape into new shape
Will eventually have to refactor, but this makes it backwards compatible for nowpull/10616/head
parent
7d180470fc
commit
549dd8969b
|
@ -1,9 +1,20 @@
|
|||
export function publishNotification(notification) {
|
||||
export function publishNotification(
|
||||
type,
|
||||
message,
|
||||
duration = 4000,
|
||||
icon = 'zap'
|
||||
) {
|
||||
// TODO: Refactor where notifications are published from and use correct shape
|
||||
// This acts as a temporary means to transform the old shape into the new one
|
||||
const notification = {
|
||||
type,
|
||||
message,
|
||||
duration,
|
||||
icon,
|
||||
}
|
||||
return {
|
||||
type: 'PUBLISH_NOTIFICATION',
|
||||
payload: {
|
||||
notification,
|
||||
},
|
||||
payload: {notification},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue