logos-innovation-lab / Kurate

https://kurate.vercel.app/
1 stars 5 forks source link

TypeError: Cannot read properties of undefined (reading 'getChatByUser') #412

Closed vojtechsimetka closed 1 year ago

vojtechsimetka commented 1 year ago

This happens when the app is initiated and the problem is that this.zkitter is undefined in the adapter (gets populated after few seconds). The solution is to correctly check for undefined values and in this specific instance delay the execution until this.zkitter is defined.

https://github.com/logos-innovation-lab/Kurate/blob/main/packages/ui/src/lib/adapters/zkitter/index.ts#L157-L159

0xtsukino commented 1 year ago

this seems to be caused by calling syncChat before start is called correct?

i think the correct fix here is to implement a waitForStart method in the adapter that resolves once start is finished, and call this.waitForStart() in methods like syncChat