2020-03-06 13:13:24 +00:00
|
|
|
import { ROOM } from '../actions/actionsTypes';
|
|
|
|
|
|
|
|
const initialState = {
|
|
|
|
rid: null,
|
|
|
|
isDeleting: false
|
|
|
|
};
|
|
|
|
|
|
|
|
export default function(state = initialState, action) {
|
|
|
|
switch (action.type) {
|
2020-03-20 16:38:01 +00:00
|
|
|
case ROOM.LEAVE:
|
2020-03-06 13:13:24 +00:00
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
rid: action.rid,
|
|
|
|
isDeleting: true
|
|
|
|
};
|
2020-03-20 16:38:01 +00:00
|
|
|
case ROOM.DELETE:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
rid: action.rid,
|
|
|
|
isDeleting: true
|
|
|
|
};
|
|
|
|
case ROOM.REMOVED:
|
2020-03-06 13:13:24 +00:00
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
isDeleting: false
|
|
|
|
};
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
}
|