Fix dashboard crash when no channels exist (#1311)

* channel value test fix

* update snapshots

* Fix dashboard crashing when no channels exist (#1305)

* add optional chaining to ids

* lint fix

* channel value test fix

* Fix dashboard crashing when no channels exist (#1305)

* add optional chaining to ids

* lint fix

* channel value test fix
This commit is contained in:
SektorDV 2021-08-20 13:14:14 +02:00 committed by GitHub
parent 12e4ff35ca
commit c5adcda1e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -198,7 +198,7 @@ const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
{isPickerActive && ( {isPickerActive && (
<AppChannelSelect <AppChannelSelect
channels={availableChannels} channels={availableChannels}
selectedChannelId={channel.id} selectedChannelId={channel?.id}
onChannelSelect={setChannel} onChannelSelect={setChannel}
/> />
)} )}
@ -207,7 +207,7 @@ const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
user={user} user={user}
onLogout={logout} onLogout={logout}
onProfileClick={() => onProfileClick={() =>
navigate(staffMemberDetailsUrl(user.id)) navigate(staffMemberDetailsUrl(user?.id))
} }
onThemeToggle={toggleTheme} onThemeToggle={toggleTheme}
/> />