diff --git a/src/client/containers/ConfigurationCreateContainer/hooks/useConfigurationCreate.ts b/src/client/containers/ConfigurationCreateContainer/hooks/useConfigurationCreate.ts index 449ee7b..387a76e 100644 --- a/src/client/containers/ConfigurationCreateContainer/hooks/useConfigurationCreate.ts +++ b/src/client/containers/ConfigurationCreateContainer/hooks/useConfigurationCreate.ts @@ -65,12 +65,8 @@ export const useConfigurationCreate = ({ channel, user }: app.Context) => { - if (!channel || !user || !user.tenant) { - // TODO: Handle undefined - return; - } - const { displayName: channelName, id: channelId } = channel; - const { tenant: { id: tenantId } } = user; + const { displayName: channelName, id: channelId } = channel ?? {}; + const { tenant: { id: tenantId } = { id: undefined } } = user ?? {}; pages.getConfig().then(settings => { pages.config.registerOnSaveHandler(async saveEvent => { if (tenantId === undefined || diff --git a/src/client/containers/ConfigurationUpdateContainer/hooks/useConfigurationUpdate.ts b/src/client/containers/ConfigurationUpdateContainer/hooks/useConfigurationUpdate.ts index 7738b2c..ea71b74 100644 --- a/src/client/containers/ConfigurationUpdateContainer/hooks/useConfigurationUpdate.ts +++ b/src/client/containers/ConfigurationUpdateContainer/hooks/useConfigurationUpdate.ts @@ -65,12 +65,8 @@ export const useConfigurationUpdate = ({ channel, user }) => { - if (!channel || !user || !user.tenant) { - // TODO: Handle undefined - return; - } - const { id: channelId, displayName: channelName } = channel; - const { tenant: { id: tenantId } } = user; + const { id: channelId, displayName: channelName } = channel ?? {}; + const { tenant: { id: tenantId } = { id: undefined } } = user ?? {}; pages.config.registerOnSaveHandler(async saveEvent => { if (tenantId === undefined || channelId === undefined ||