Only listen on chatCollection if we are in troupe context
Closes #2260 (closed)
Chat collection can't be initialized when there's no troupe in the context.
There is a full page refresh between the room and non-room pages, so the condition can be checked during data-bridge
initialization.
Testing
- Go from home to a room page
- Go from room page to home or learn page (using the user dropdown)
There should be no errors in Dev Tools console and the JavaScript should work on both pages.
Edited by Tomas Vik