Skip to content

Commit

Permalink
fix: Remove early return and todo
Browse files Browse the repository at this point in the history
  • Loading branch information
melsener committed Apr 1, 2024
1 parent 70468f5 commit 1d58e48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down

0 comments on commit 1d58e48

Please sign in to comment.