Skip to content

Commit

Permalink
Make settings elements falsy check
Browse files Browse the repository at this point in the history
  • Loading branch information
sazanrjb committed Dec 18, 2023
1 parent 37a8bc6 commit 8697936
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ async function getContent(searchParams: SearchParams) {

const populateSettingsFormData = (settings: SettingResponse): Omit<SettingsData, 'sender'> => {
return {
autoRespond: settings.type || $Enums.SettingType.DISABLED,
response: settings.message || null,
timezone: settings.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone,
selectedDays: (settings.workingHours || [])?.map((workingHour) => ({
autoRespond: settings?.type || $Enums.SettingType.DISABLED,
response: settings?.message || null,
timezone: settings?.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone,
selectedDays: (settings?.workingHours || [])?.map((workingHour) => ({
day: workingHour.weekday,
startHour: workingHour.startTime as HOUR,
endHour: workingHour.endTime as HOUR,
Expand Down

0 comments on commit 8697936

Please sign in to comment.