This fixes the error found by @dipak-demansol in #4. The channel header icon contained the logic for fetching the notes for each channel, so when we use the App Bar icon (which prevents the channel header icon from being mounted) that logic is never executed.
To solve this, I added a listener for the CHANNEL_VIEWED websocket event, so that when the user switches channel, the notes for that channel are fetched.
With this change, the old logic of the channel header icon changing its colour whenever the current channel has notes still works, and the bug found in #4 when the App Bar icon is shown is solved.
This fixes the error found by @dipak-demansol in #4. The channel header icon contained the logic for fetching the notes for each channel, so when we use the App Bar icon (which prevents the channel header icon from being mounted) that logic is never executed.
To solve this, I added a listener for the
CHANNEL_VIEWED
websocket event, so that when the user switches channel, the notes for that channel are fetched.With this change, the old logic of the channel header icon changing its colour whenever the current channel has notes still works, and the bug found in #4 when the App Bar icon is shown is solved.