fix: Lid is missing in chat table (#3703)

* Use window.Store.FindOrCreateChat.findOrCreateLatestChat to get chat

* refactor: change find to findOrCreateLatestChat

* refactor: update 'injectToFunction' to support nested props in modules

* fix: resolve 'Lid is missing in chat table' error

---------

Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com>
This commit is contained in:
Seow Zhen Jun 2025-09-06 03:19:15 +08:00 • committed by GitHub
commit 5276e30ac6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 5 deletions

View file

@ -539,7 +539,7 @@ exports.LoadUtils = () => {
chat = null;
}
} else {
chat = window.Store.Chat.get(chatWid) || (await window.Store.Chat.find(chatWid));
chat = window.Store.Chat.get(chatWid) || (await window.Store.FindOrCreateChat.findOrCreateLatestChat(chatWid))?.chat;
}
return getAsModel && chat