Modals, including sharing auth
This commit is contained in:
@ -89,7 +89,13 @@ const PusherMiddleware = (function(){
|
||||
store.dispatch(spotifyActions.tokenChanged(message.params.spotify_token));
|
||||
break;
|
||||
case 'spotify_authorization_received':
|
||||
store.dispatch(uiActions.openModal('receive_authorization', message.params));
|
||||
console.log(message);
|
||||
store.dispatch(uiActions.createNotification({
|
||||
type: 'spotify-authorization-received',
|
||||
authorization: message.params.authorization,
|
||||
user: message.params.user,
|
||||
sticky: true
|
||||
}));
|
||||
break;
|
||||
case 'notification':
|
||||
store.dispatch(uiActions.createNotification(message.params.notification));
|
||||
|
||||
@ -239,17 +239,11 @@ export function tokenChanged(spotify_token){
|
||||
}
|
||||
}
|
||||
|
||||
export function authorizationReceived(data){
|
||||
|
||||
// This is just an alias to open the modal
|
||||
return uiActions.openModal('receive_authorization', data);
|
||||
}
|
||||
|
||||
export function importAuthorization(data){
|
||||
export function importAuthorization(user, authorization){
|
||||
return {
|
||||
type: 'SPOTIFY_IMPORT_AUTHORIZATION',
|
||||
user: data.user,
|
||||
authorization: data.authorization
|
||||
user: user,
|
||||
authorization: authorization
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -150,8 +150,6 @@ export function createBrowserNotification(data){
|
||||
}
|
||||
}
|
||||
|
||||
// content, type = 'default', key = null, title = null, description = null, sticky = false
|
||||
|
||||
export function createNotification(data){
|
||||
return {
|
||||
type: 'CREATE_NOTIFICATION',
|
||||
@ -164,7 +162,8 @@ export function createNotification(data){
|
||||
content: null,
|
||||
description: null,
|
||||
sticky: false,
|
||||
closing: false
|
||||
closing: false,
|
||||
render_content: false
|
||||
},
|
||||
data
|
||||
)
|
||||
|
||||
@ -147,7 +147,7 @@ const UIMiddleware = (function(){
|
||||
|
||||
case 'BROADCASTS_LOADED':
|
||||
var suppressed_broadcasts = []
|
||||
if (typeof(store.getState().ui.suppressed_broadcasts) !== 'undefined'){
|
||||
if (store.getState().ui.suppressed_broadcasts !== undefined){
|
||||
suppressed_broadcasts = store.getState().ui.suppressed_broadcasts
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ const UIMiddleware = (function(){
|
||||
key: (broadcast.key ? broadcast.key : null),
|
||||
title: (broadcast.title ? broadcast.title : null),
|
||||
content: broadcast.message,
|
||||
type: 'broadcast',
|
||||
type: 'info',
|
||||
sticky: true
|
||||
}
|
||||
store.dispatch(uiActions.createNotification(data));
|
||||
|
||||
Reference in New Issue
Block a user