Commit 5f180569 by Sixong.Zhu

Merge branch 'pre' into release

parents 9feacc13 22b60c2e
Showing with 11 additions and 8 deletions
......@@ -8,7 +8,7 @@
width="90%"
>
<div class="d-flex flex-column">
<div class="d-flex justify-content-center">
<div class="d-flex justify-content-center align-items-start">
<img v-if="file" :src="file.url" />
<i class="el-icon-close" @click="close"></i>
</div>
......
......@@ -433,7 +433,7 @@ export default {
},
},
actions: {
async [ChatStore.ACTION_GET_MY_CHAT_LIST]({ commit, dispatch }) {
async [ChatStore.ACTION_GET_MY_CHAT_LIST]({ commit, dispatch, state }) {
commit(ChatStore.MUTATION_SAVE_MYSELF_ID);
if (loadingChatList) {
......@@ -465,7 +465,8 @@ export default {
);
dispatch(
ChatStore.ACTION_REBUILD_UNREAD_MESSAGE_COUNT
).finally(resolve);
);
resolve(items);
})
.catch(reject);
});
......@@ -473,11 +474,13 @@ export default {
return await execute().then((d) => clearAction(d));
},
async [ChatStore.ACTION_REBUILD_UNREAD_MESSAGE_COUNT]({ state }) {
let items = await dbController.getChatList();
let sum = 0;
items.forEach((i) => (sum += i.unread_msg_count));
state[ChatStore.STATE_CURRENT_UNREAD_MESSAGE_COUNT] = sum;
[ChatStore.ACTION_REBUILD_UNREAD_MESSAGE_COUNT]({ state }) {
const items = state[ChatStore.STATE_MY_CHAT_ROOM_LIST];
if (items) {
let sum = 0;
items.forEach((i) => (sum += i.unread_msg_count));
state[ChatStore.STATE_CURRENT_UNREAD_MESSAGE_COUNT] = sum;
}
},
async [ChatStore.ACTION_UPDATE_CHAT_UNREAD_MESSAGE_COUNT](
{ dispatch, state },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment