From b3fa6e2d4e78c8b03716a07cede1e5705a2f7cfe Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Mon, 29 Jul 2024 14:18:02 -0600 Subject: [PATCH 1/3] check if bhType is valid before registering --- apps/meteor/app/livechat-enterprise/client/startup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/app/livechat-enterprise/client/startup.ts b/apps/meteor/app/livechat-enterprise/client/startup.ts index 0535f8926a7d..2fd04755807f 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 ((await hasLicense('livechat-enterprise')) && bhType) { businessHourManager.registerBusinessHourBehavior(businessHours[bhType.toLowerCase()]); } }); From e107c0fa28191fa838dfe55e04aa13566e207275 Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Mon, 29 Jul 2024 14:37:36 -0600 Subject: [PATCH 2/3] Create popular-bottles-visit.md --- .changeset/popular-bottles-visit.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/popular-bottles-visit.md 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`. From 7c22d9a986efc144e9125d5e327c2106ef878882 Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Wed, 31 Jul 2024 07:36:05 -0600 Subject: [PATCH 3/3] Update apps/meteor/app/livechat-enterprise/client/startup.ts Co-authored-by: Guilherme Gazzo --- apps/meteor/app/livechat-enterprise/client/startup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/app/livechat-enterprise/client/startup.ts b/apps/meteor/app/livechat-enterprise/client/startup.ts index 2fd04755807f..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')) && bhType) { + if (bhType && (await hasLicense('livechat-enterprise'))) { businessHourManager.registerBusinessHourBehavior(businessHours[bhType.toLowerCase()]); } });