diff --git a/src/hooks/useTalkRecord.js b/src/hooks/useTalkRecord.js index 51596b1..f9dcc76 100644 --- a/src/hooks/useTalkRecord.js +++ b/src/hooks/useTalkRecord.js @@ -114,7 +114,8 @@ export const useTalkRecord = (uid) => { ) zpagingComplete(dialogueStore.index_name, reverseItems) const dialogueList = getDialogueList(dialogueStore.index_name) - loadConfig.status = dialogueList.records?.[0]?.sequence > 1 ? 1 : 2 + loadConfig.status = + dialogueList.records?.[0]?.sequence > 1 && data?.items?.length > 0 ? 1 : 2 // loadConfig.cursor = data.cursor nextTick(() => { diff --git a/src/pages/dialog/index.vue b/src/pages/dialog/index.vue index 474e2dc..b08a70c 100644 --- a/src/pages/dialog/index.vue +++ b/src/pages/dialog/index.vue @@ -831,9 +831,9 @@ watch( (newValue, oldValue) => { if (newValue) { const dialogueList = getDialogueList(talkParams.index_name) - console.log(newValue[newValue.length - 1].sequence, dialogueList.records?.[0]?.sequence) + // console.log(newValue[newValue.length - 1]?.sequence, dialogueList?.records?.[0]?.sequence) if ( - newValue[newValue.length - 1].sequence === + newValue[newValue.length - 1]?.sequence === dialogueList.records?.[0]?.sequence ) { //相同意味着分页加载缓存中的聊天记录完毕