From 4335bda2be04faa4137796d44a132aaedbd9cf0b Mon Sep 17 00:00:00 2001 From: Saikat Mitra Date: Fri, 8 Sep 2023 13:16:07 +0530 Subject: [PATCH] fix: staging link throwing layout api error --- apps/100ms-custom-app/src/utils/utils.js | 2 +- .../provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/100ms-custom-app/src/utils/utils.js b/apps/100ms-custom-app/src/utils/utils.js index 8c89b98f34..c26c0ef987 100644 --- a/apps/100ms-custom-app/src/utils/utils.js +++ b/apps/100ms-custom-app/src/utils/utils.js @@ -2,7 +2,7 @@ import axios from 'axios'; import cookies from 'js-cookies'; function isRoomCode(str) { - const regex = /^[A-Za-z]{3}(-[A-Za-z]{3,4}){2}$/; + const regex = /^[A-Za-z]*(-[A-Za-z]*){2}$/; return regex.test(str); } diff --git a/packages/roomkit-react/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts b/packages/roomkit-react/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts index 9af36a7790..2a01083d4a 100644 --- a/packages/roomkit-react/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +++ b/packages/roomkit-react/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts @@ -29,7 +29,7 @@ export type useFetchRoomLayoutResponse = { }; export const useFetchRoomLayout = ({ - endpoint = 'https://api.100ms.live/v2/layouts/ui', + endpoint = '', authToken = '', }: useFetchRoomLayoutProps): useFetchRoomLayoutResponse => { const [layout, setLayout] = useState(undefined); @@ -51,7 +51,7 @@ export const useFetchRoomLayout = ({ } isFetchInProgress.current = true; try { - const resp = await fetchWithRetry(endpoint, { + const resp = await fetchWithRetry(endpoint || 'https://api.100ms.live/v2/layouts/ui', { headers: { Authorization: `Bearer ${authToken}`, },