Add button to mark chat read on chat-bottom-bar; make icon-btn icon color change to ensure visibility with hover effects; make waha show in-app notification for errors.
This commit is contained in:
parent
418f858807
commit
932e63e299
7 changed files with 38 additions and 3 deletions
13
js/db.js
13
js/db.js
|
|
@ -107,6 +107,19 @@ export async function loadChatsSorted() {
|
|||
});
|
||||
}
|
||||
|
||||
export async function loadChat(chatId) {
|
||||
const db = await openDb();
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const tx = db.transaction("chats", "readonly");
|
||||
const store = tx.objectStore("chats");
|
||||
const req = store.get(chatId);
|
||||
|
||||
tx.oncomplete = () => resolve(req.result)
|
||||
tx.onerror = () => reject(req.error);
|
||||
});
|
||||
}
|
||||
|
||||
function mapMessage(m) {
|
||||
const from = normalizeId(m.from);
|
||||
const to = normalizeId(m.to);
|
||||
|
|
|
|||
Loading…
Reference in a new issue