From 4a097a613b1b7290520940350c889b0fe45dea99 Mon Sep 17 00:00:00 2001 From: Cola-Echo Date: Fri, 2 Jan 2026 02:48:58 +0800 Subject: [PATCH] Add files via upload --- main.js | 5 +++++ ui.js | 2 ++ 2 files changed, 7 insertions(+) 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 = '[语音]';