Skip to content

Commit 6cc819e

Browse files
committed
fixup: use persisted state for the entrypoint
1 parent 3713238 commit 6cc819e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/compass-web/src/entrypoint.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ import {
1515
DatabasesWorkspaceTab,
1616
CollectionsWorkspaceTab,
1717
} from '@mongodb-js/compass-databases-collections';
18-
import { CompassComponentsProvider, css } from '@mongodb-js/compass-components';
18+
import {
19+
CompassComponentsProvider,
20+
css,
21+
usePersistedState,
22+
} from '@mongodb-js/compass-components';
1923
import {
2024
WorkspaceTab as CollectionWorkspace,
2125
CollectionTabsProvider,
@@ -262,6 +266,9 @@ const CompassWeb = ({
262266
onLog,
263267
onDebug,
264268
});
269+
const [telemetryAnonymousId] = usePersistedState('telemetryAnonymousId', () =>
270+
new UUID().toString()
271+
);
265272

266273
const preferencesAccess = useRef(
267274
new CompassWebPreferencesAccess({
@@ -285,7 +292,7 @@ const CompassWeb = ({
285292
enableCreatingNewConnections: false,
286293
enableGlobalWrites: false,
287294
optInDataExplorerGenAIFeatures: false,
288-
telemetryAnonymousId: new UUID().toString(),
295+
telemetryAnonymousId,
289296
...initialPreferences,
290297
})
291298
);

0 commit comments

Comments
 (0)