...
|
...
|
@@ -54,7 +54,12 @@ export function requestMsgListFailure(error) { |
|
|
}
|
|
|
|
|
|
export function getMsgList(brandId) {
|
|
|
return dispatch => {
|
|
|
return (dispatch, getState) => {
|
|
|
const {message} = getState();
|
|
|
if (!shouldRequestMsgList(message)) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
dispatch(requestMsgList(brandId));
|
|
|
return new MessageService().getMsgList(brandId)
|
|
|
.then(json => {
|
...
|
...
|
@@ -66,6 +71,14 @@ export function getMsgList(brandId) { |
|
|
};
|
|
|
}
|
|
|
|
|
|
export function shouldRequestMsgList(message) {
|
|
|
if (message.isFetching || message.messageList.size != 0) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
export function setMsgIsRead(brandId, messageId) {
|
|
|
return dispatch => {
|
|
|
dispatch(batchSetMsgRead());
|
...
|
...
|
|