[Update Package] whole packages updated.
This commit is contained in:
@@ -13,7 +13,7 @@ import { Map } from 'immutable'
|
||||
* @param {object} state
|
||||
* @param {object} action
|
||||
*/
|
||||
export let authorizeReducer = (state = Map(new AuthorizeState()), action: IAuthorizeAction) => {
|
||||
export let authorizeReducer = (state = Map(new AuthorizeState() as any), action: IAuthorizeAction) => {
|
||||
const { payload } = action
|
||||
switch (action.type) {
|
||||
case AuthorizeActionType.LOGIN:
|
||||
|
||||
@@ -3,22 +3,16 @@ import {Map} from 'immutable'
|
||||
|
||||
/**
|
||||
* Circle state
|
||||
*
|
||||
* @export
|
||||
* @class CircleState
|
||||
*/
|
||||
export class CircleState {
|
||||
[key: string]: any
|
||||
/**
|
||||
* The list of users belong to users circle
|
||||
*
|
||||
* @memberof CircleState
|
||||
*/
|
||||
userTies: Map<string, UserTie> = Map({})
|
||||
|
||||
/**
|
||||
* The list of users belong to users circle
|
||||
*
|
||||
* @memberof CircleState
|
||||
*/
|
||||
userTieds: Map<string, UserTie> = Map({})
|
||||
|
||||
@@ -49,8 +43,6 @@ export class CircleState {
|
||||
|
||||
/**
|
||||
* If user circles are loaded {true} or not {false}
|
||||
*
|
||||
* @memberof CircleState
|
||||
*/
|
||||
loaded: boolean = false
|
||||
|
||||
|
||||
@@ -136,11 +136,10 @@ export let circleReducer = (state = Map(new CircleState()), action: ICircleActio
|
||||
/**
|
||||
* Map user ties selected to selected circles
|
||||
*/
|
||||
const getSelectedCircles = (userTies: { [userId: string]: UserTie }) => {
|
||||
const getSelectedCircles = (userTies: Map<string, any>) => {
|
||||
let selectedCircles: Map<string, List<string>> = Map({})
|
||||
Object.keys(userTies).forEach((userId: string) => {
|
||||
const userTie = (userTies as { [userId: string]: UserTie })[userId]
|
||||
selectedCircles = selectedCircles.set(userTie.userId!, List(userTie.circleIdList!))
|
||||
userTies.forEach((userTie) => {
|
||||
selectedCircles = selectedCircles.set(userTie.get('userId'), List(userTie.get('circleIdList')))
|
||||
})
|
||||
|
||||
return selectedCircles
|
||||
|
||||
@@ -9,6 +9,8 @@ import {Map} from 'immutable'
|
||||
*/
|
||||
export class CommentState {
|
||||
|
||||
[key: string]: any
|
||||
|
||||
/**
|
||||
* The list of comments on the posts
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,7 @@ export let commentReducer = (state = Map(new CommentState()), action: ICommentAc
|
||||
/* _____________ CRUD _____________ */
|
||||
case CommentActionType.ADD_COMMENT:
|
||||
return state
|
||||
.setIn(['postComments', payload.postId, payload.id], payload)
|
||||
.setIn(['postComments', payload.get('postId'), payload.get('id')], payload)
|
||||
|
||||
case CommentActionType.ADD_COMMENT_LIST:
|
||||
return state
|
||||
|
||||
@@ -7,6 +7,8 @@ import { Map, fromJS, List } from 'immutable'
|
||||
*/
|
||||
export class GlobalState {
|
||||
|
||||
[key: string]: any
|
||||
|
||||
/**
|
||||
* Set percent of loading progress and visibility for Master component
|
||||
*
|
||||
|
||||
@@ -8,6 +8,8 @@ import {Map, Collection, List} from 'immutable'
|
||||
* @class ImageGalleryState
|
||||
*/
|
||||
export class ImageGalleryState {
|
||||
|
||||
[key: string]: any
|
||||
|
||||
/**
|
||||
* Image gallery is open {true} or not {false}
|
||||
|
||||
@@ -9,6 +9,8 @@ import {Map} from 'immutable'
|
||||
*/
|
||||
export class NotificationState {
|
||||
|
||||
[key: string]: any
|
||||
|
||||
/**
|
||||
* The list of users notification
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Map, fromJS, List } from 'immutable'
|
||||
* @class PostState
|
||||
*/
|
||||
export class PostState {
|
||||
|
||||
[key: string]: any
|
||||
/**
|
||||
* The list of user posts
|
||||
*
|
||||
|
||||
@@ -14,10 +14,10 @@ import { postReducer } from './posts'
|
||||
import { userReducer } from './users'
|
||||
import { voteReducer } from './votes'
|
||||
import { serverReducer } from './server'
|
||||
import { routerReducer, routerMiddleware } from 'react-router-redux'
|
||||
import { connectRouter } from 'connected-react-router/immutable'
|
||||
|
||||
// - Reducers
|
||||
export const rootReducer = combineReducers({
|
||||
export const rootReducer = (history: any) => combineReducers({
|
||||
locale,
|
||||
imageGallery: imageGalleryReducer,
|
||||
post: postReducer,
|
||||
@@ -26,7 +26,7 @@ export const rootReducer = combineReducers({
|
||||
vote: voteReducer,
|
||||
server: serverReducer,
|
||||
authorize: authorizeReducer,
|
||||
router: routerReducer,
|
||||
router: connectRouter(history),
|
||||
user: userReducer,
|
||||
notify: notificationReducer,
|
||||
global: globalReducer
|
||||
|
||||
@@ -8,7 +8,7 @@ import {Map} from 'immutable'
|
||||
* @class ServerState
|
||||
*/
|
||||
export class ServerState {
|
||||
|
||||
[key: string]: any
|
||||
/**
|
||||
* The list of posts server
|
||||
* @memberof ServerState
|
||||
|
||||
@@ -8,6 +8,7 @@ import { Map, fromJS, List } from 'immutable'
|
||||
* @class UserState
|
||||
*/
|
||||
export class UserState {
|
||||
[key: string]: any
|
||||
/**
|
||||
* The list of users information
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Vote } from 'src/core/domain/votes'
|
||||
* @class VoteState
|
||||
*/
|
||||
export class VoteState {
|
||||
|
||||
[key: string]: any
|
||||
/**
|
||||
* The list of posts vote
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user