合并
This commit is contained in:
parent
afa9edd3ad
commit
99e3c0ac63
12
src/chat.js
12
src/chat.js
@ -170,14 +170,10 @@ export default class Chat {
|
||||
存储消息(data) {
|
||||
set(data.id, data, this.store)
|
||||
}
|
||||
载入消息() {
|
||||
values(this.store).then(items => {
|
||||
items.map(item => {
|
||||
item.timestamp = new Date(item.time).getTime()
|
||||
return item
|
||||
}).sort((a, b) => a.timestamp - b.timestamp).forEach(item => {
|
||||
this.添加元素(item)
|
||||
})
|
||||
async 载入消息() {
|
||||
const data = await values(this.store)
|
||||
data.map(item => ({ timestamp: new Date(item.time).getTime(), ...item })).sort((a, b) => a.timestamp - b.timestamp).forEach(item => {
|
||||
this.添加元素(item)
|
||||
})
|
||||
}
|
||||
发送消息(text) {
|
||||
|
Loading…
Reference in New Issue
Block a user