From 43be10cef26e937aca6a9cc2e64aff7fe5dd3c30 Mon Sep 17 00:00:00 2001 From: Scott Kang Date: Fri, 6 Oct 2023 10:43:31 +0800 Subject: [PATCH] fix: unit test failures --- src/components/AzureMap/AzureMap.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/AzureMap/AzureMap.tsx b/src/components/AzureMap/AzureMap.tsx index f79aaaf..be92553 100644 --- a/src/components/AzureMap/AzureMap.tsx +++ b/src/components/AzureMap/AzureMap.tsx @@ -99,11 +99,11 @@ const AzureMap = memo( useEffect(() => { if (mapRefSource.current === null) { - if (!options.sessionId) { + mapRefSource.current = new atlas.Map(mapId, { + ...(options || {}), // Assign default session ID with a prefix - atlas.setSessionId(`react-azure-maps:${Guid.create().toString()}`) - } - mapRefSource.current = new atlas.Map(mapId, options) + sessionId: options?.sessionId || `react-azure-maps:${Guid.create().toString()}` + }) } setMapRef(mapRefSource.current) return () => {