Skip to content

Commit 587123e

Browse files
fix: appzi page crash in case of missing chunk (#7363)
1 parent 1bfdebb commit 587123e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

apps/cowswap-frontend/src/appzi.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ type AppziSettings = {
7373
}
7474

7575
function initialize(): void {
76-
if (isAppziEnabled) {
77-
ReactAppzi.initialize(APPZI_TOKEN)
76+
if (!isAppziEnabled || typeof window === 'undefined') return
7877

79-
if (typeof window !== 'undefined') {
80-
window.appziSettings = window.appziSettings || {}
81-
}
82-
}
78+
window.appziSettings = window.appziSettings || {}
79+
80+
try {
81+
ReactAppzi.initialize(APPZI_TOKEN)
82+
} catch {}
8383
}
8484

8585
function updateAppziSettings({ data = {}, userId = '' }: AppziSettings): void {

0 commit comments

Comments
 (0)