Fix no channels crash (#984)
* Fix crash caused by not having any channels * Update changelog
This commit is contained in:
parent
1bf9254428
commit
afa228fd6d
2 changed files with 2 additions and 1 deletions
|
@ -19,6 +19,7 @@ All notable, unreleased changes to this project will be documented in this file.
|
|||
- Drop descriptionJson and contentJson fields - #950 by @jwm0
|
||||
- Add error tracking with Sentry adapter - #956 by @jwm0
|
||||
- Add OAuth2 login with OpenID support - #963 by @orzechdev
|
||||
- Fix no channels crash - #984 by @dominik-zeglen
|
||||
|
||||
# 2.11.1
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ export const AppChannelProvider: React.FC = ({ children }) => {
|
|||
|
||||
const [isPickerActive, setPickerActive] = React.useState(false);
|
||||
React.useEffect(() => {
|
||||
if (!selectedChannel && channelData?.channels) {
|
||||
if (!selectedChannel && channelData?.channels?.length > 0) {
|
||||
setSelectedChannel(channelData.channels[0].id);
|
||||
}
|
||||
}, [channelData]);
|
||||
|
|
Loading…
Reference in a new issue