Notifications for events
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
var actions = require('./actions.js')
|
||||
var uiActions = require('./actions.js')
|
||||
var spotifyActions = require('../spotify/actions.js')
|
||||
var helpers = require('../../helpers.js')
|
||||
|
||||
@ -18,7 +18,7 @@ const UIMiddleware = (function(){
|
||||
// start a timeout to remove this notification
|
||||
var timeout = setTimeout(
|
||||
function(){
|
||||
store.dispatch(actions.removeNotification(action.notification.id))
|
||||
store.dispatch(uiActions.removeNotification(action.notification.id))
|
||||
},
|
||||
3000
|
||||
)
|
||||
@ -27,6 +27,14 @@ const UIMiddleware = (function(){
|
||||
next(action)
|
||||
break
|
||||
|
||||
case 'PLAYLIST_TRACKS_ADDED':
|
||||
|
||||
store.dispatch(uiActions.createNotification('Added '+action.tracks_uris.length+' tracks to playlist'))
|
||||
|
||||
// we don't want to stop things happening as usual
|
||||
next(action)
|
||||
break
|
||||
|
||||
// This action is irrelevant to us, pass it on to the next middleware
|
||||
default:
|
||||
return next(action)
|
||||
|
||||
Reference in New Issue
Block a user