Commit 887ff12a by Sixong.Zhu

u

parent 794e3e97
Showing with 4 additions and 4 deletions
...@@ -469,7 +469,7 @@ export default { ...@@ -469,7 +469,7 @@ export default {
.sort(); .sort();
const last = ts[ts.length - 1]; const last = ts[ts.length - 1];
const execute = () => const execute = () =>
new Promise<ChatType[]>((resolve) => { new Promise<ChatType[]>((resolve, reject) => {
Chat.onReady(() => { Chat.onReady(() => {
xim.fetchChatListAfter(last)!.then((r) => { xim.fetchChatListAfter(last)!.then((r) => {
const list = filterActiveChats( const list = filterActiveChats(
...@@ -483,7 +483,7 @@ export default { ...@@ -483,7 +483,7 @@ export default {
); );
} }
resolve(buildUnreadMessage(cache)); resolve(buildUnreadMessage(cache));
}); }).catch(reject);
}); });
}).finally(() => (loadingChatList = false)); }).finally(() => (loadingChatList = false));
...@@ -491,7 +491,7 @@ export default { ...@@ -491,7 +491,7 @@ export default {
} }
const execute = () => const execute = () =>
new Promise<ChatType[]>((resolve) => { new Promise<ChatType[]>((resolve, reject) => {
Chat.onReady(() => { Chat.onReady(() => {
xim.fetchChatList().then((data) => { xim.fetchChatList().then((data) => {
if (!data) { if (!data) {
...@@ -506,7 +506,7 @@ export default { ...@@ -506,7 +506,7 @@ export default {
dbController.saveChatList(items); dbController.saveChatList(items);
commit(ChatStore.MUTATION_SAVE_CHAT_LIST, items); commit(ChatStore.MUTATION_SAVE_CHAT_LIST, items);
resolve(buildUnreadMessage(items)); resolve(buildUnreadMessage(items));
}); }).catch(reject);
}); });
}).finally(() => (loadingChatList = false)); }).finally(() => (loadingChatList = false));
......
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