diff --git a/main.js b/main.js index 36d0f4d..c5a62cf 100644 --- a/main.js +++ b/main.js @@ -2883,13 +2883,18 @@ function bindEvents() { } function init() { + console.log('[可乐] init() 开始'); loadSettings(); + console.log('[可乐] loadSettings 调用完成,开始 getSettings'); const settings = getSettings(); + console.log('[可乐] getSettings 完成,开始 seedDefaultUserPersonaFromST'); if (seedDefaultUserPersonaFromST(settings)) { requestSave(); } + console.log('[可乐] seedDefaultUserPersonaFromST 完成,开始 generatePhoneHTML'); const phoneHTML = generatePhoneHTML(); + console.log('[可乐] generatePhoneHTML 完成'); document.body.insertAdjacentHTML('beforeend', phoneHTML); setupPhoneAutoCentering(); diff --git a/ui.js b/ui.js index 98de308..3b96652 100644 --- a/ui.js +++ b/ui.js @@ -180,7 +180,9 @@ export function generateChatList() { // 生成单聊列表项 function generateContactChatItem(contact) { + if (!contact) return ''; const lastMsg = contact.lastMsg; + if (!lastMsg) return ''; let preview = ''; if (lastMsg.type === 'voice' || lastMsg.isVoice) { preview = '[语音]';