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:
Felicio Mununga 2022-06-13 22:44:12 +02:00 committed by GitHub
parent b7e61f16d1
commit 8bdff5d869
No known key found for this signature in database
GPG Key ID: 0EB8D75C775AB6F1
1 changed files with 2 additions and 2 deletions

View File

@ -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) => {