File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
common/components/shell/gtm Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,11 @@ export function SafeGTM({ gtmId}: { gtmId: string}) {
99 const [ canLoad , setCanLoad ] = useState ( false )
1010
1111 useEffect ( ( ) => {
12- /* const hash = window.location.hash
12+ /** GTM can make the app crash when large tokens are sent via hash
13+ * This code deletes temporaly the hash, loads the GTM and then puts it
14+ * back again
15+ */
16+ const hash = window . location . hash
1317 const hasLargeHash = hash . length > MAX_HASH_LENGTH
1418 let originalHash = ""
1519 if ( hasLargeHash ) {
@@ -18,7 +22,7 @@ export function SafeGTM({ gtmId}: { gtmId: string}) {
1822 setTimeout ( ( ) => {
1923 window . location . hash = originalHash
2024 } , 500 )
21- } */
25+ }
2226 setCanLoad ( true )
2327 } , [ ] )
2428
Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ export const TokenDecoderComponent: React.FC<TokenDecoderComponentProps> = ({
5151
5252 useEffect ( ( ) => {
5353 const handleHashChange = ( ) => {
54- console . count ( "hash handler fired" )
5554 const hash = window . location . hash . substring ( 1 ) ;
5655
5756 if ( hash . includes ( "debugger-io?token=" ) ) {
You can’t perform that action at this time.
0 commit comments