Return new array on emit to trigger re-rendering in react (#273)
* fix type * return new array to trigger re-rendering in react
This commit is contained in:
parent
f62e3ff014
commit
fade36ec54
|
@ -120,7 +120,7 @@ export class Chat {
|
||||||
const startTime = options.start
|
const startTime = options.start
|
||||||
const endTime = new Date()
|
const endTime = new Date()
|
||||||
|
|
||||||
let _oldestClock: BigInt | undefined
|
let _oldestClock: bigint | undefined
|
||||||
let _oldestMessageTime: Date | undefined
|
let _oldestMessageTime: Date | undefined
|
||||||
|
|
||||||
if (this.messages.length) {
|
if (this.messages.length) {
|
||||||
|
@ -169,7 +169,7 @@ export class Chat {
|
||||||
|
|
||||||
public emitMessages = (messages: ChatMessage[]) => {
|
public emitMessages = (messages: ChatMessage[]) => {
|
||||||
// fixme!: don't emit on backfill
|
// fixme!: don't emit on backfill
|
||||||
this.messageCallbacks.forEach(callback => callback(messages))
|
this.messageCallbacks.forEach(callback => callback([...messages]))
|
||||||
}
|
}
|
||||||
|
|
||||||
public handleChange = (description: CommunityChat) => {
|
public handleChange = (description: CommunityChat) => {
|
||||||
|
|
Loading…
Reference in New Issue