Skip to content

Commit 5ba66a6

Browse files
Merge pull request #175 from yulinscottkang/unit
fix: unit test failures
2 parents 62f09ae + 43be10c commit 5ba66a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/AzureMap/AzureMap.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ const AzureMap = memo(
9999

100100
useEffect(() => {
101101
if (mapRefSource.current === null) {
102-
if (!options.sessionId) {
102+
mapRefSource.current = new atlas.Map(mapId, {
103+
...(options || {}),
103104
// Assign default session ID with a prefix
104-
atlas.setSessionId(`react-azure-maps:${Guid.create().toString()}`)
105-
}
106-
mapRefSource.current = new atlas.Map(mapId, options)
105+
sessionId: options?.sessionId || `react-azure-maps:${Guid.create().toString()}`
106+
})
107107
}
108108
setMapRef(mapRefSource.current)
109109
return () => {

0 commit comments

Comments
 (0)