diff --git a/.changeset/popular-bottles-visit.md b/.changeset/popular-bottles-visit.md new file mode 100644 index 000000000000..9e44e9dd7144 --- /dev/null +++ b/.changeset/popular-bottles-visit.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed an issue that caused UI to show an error when the call to get the Business Hour type from settings returned `undefined`. diff --git a/apps/meteor/app/livechat-enterprise/client/startup.ts b/apps/meteor/app/livechat-enterprise/client/startup.ts index 0535f8926a7d..bdf6c2549816 100644 --- a/apps/meteor/app/livechat-enterprise/client/startup.ts +++ b/apps/meteor/app/livechat-enterprise/client/startup.ts @@ -15,7 +15,7 @@ const businessHours: Record = { Meteor.startup(() => { Tracker.autorun(async () => { const bhType = settings.get('Livechat_business_hour_type'); - if (await hasLicense('livechat-enterprise')) { + if (bhType && (await hasLicense('livechat-enterprise'))) { businessHourManager.registerBusinessHourBehavior(businessHours[bhType.toLowerCase()]); } });