Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit 40d75c0

Browse files
get config with delay (#398)
1 parent 90bbd49 commit 40d75c0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

client/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function App({ deviceContextValue }: Props) {
2121
const [envConfig, setEnvConfig] = useState({});
2222

2323
useEffect(() => {
24-
getConfig().then(setEnvConfig);
24+
setTimeout(() => getConfig().then(setEnvConfig), 1000); // server returns wrong tracking_id within first second
2525
}, []);
2626

2727
const deviceContextWithEnv = useMemo(

client/src/context/providers/AnalyticsContextProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const AnalyticsContextProvider: React.FC<AnalyticsProviderProps> = ({
5959
useEffect(() => {
6060
if (analyticsLoaded && envConfig.tracking_id) {
6161
analytics.identify(
62-
envConfig.tracking_id,
62+
envConfig.tracking_id.trim(),
6363
{
6464
isSelfServe: isSelfServe,
6565
githubUsername: envConfig.user_login || '',

0 commit comments

Comments
 (0)