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
b7e61f16d1
commit
8bdff5d869
|
@ -120,7 +120,7 @@ export class Chat {
|
|||
const startTime = options.start
|
||||
const endTime = new Date()
|
||||
|
||||
let _oldestClock: BigInt | undefined
|
||||
let _oldestClock: bigint | undefined
|
||||
let _oldestMessageTime: Date | undefined
|
||||
|
||||
if (this.messages.length) {
|
||||
|
@ -169,7 +169,7 @@ export class Chat {
|
|||
|
||||
public emitMessages = (messages: ChatMessage[]) => {
|
||||
// fixme!: don't emit on backfill
|
||||
this.messageCallbacks.forEach(callback => callback(messages))
|
||||
this.messageCallbacks.forEach(callback => callback([...messages]))
|
||||
}
|
||||
|
||||
public handleChange = (description: CommunityChat) => {
|
||||
|
|
Loading…
Reference in New Issue