Skip to content

Commit

Permalink
Merge pull request RedHatInsights#2720 from Hyperkid123/hide-pendo-ln…
Browse files Browse the repository at this point in the history
…aidng-page

Increase interval for hiding pendo badge on landing page.
  • Loading branch information
Hyperkid123 authored Dec 4, 2023
2 parents 7031d66 + 5a8287e commit 29ca371
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/hooks/useDisablePendoOnLanding.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { useEffect } from 'react';
import { useSelector } from 'react-redux';
import { ReduxState } from '../redux/store';
import { isProd } from '../utils/common';
import { isITLessEnv } from '../utils/consts';

// interval timing is short because we want to catch the bubble before ASAP so it does not cover the VA button
const RETRY_ATTEMPS = 500;
const RETRY_ATTEMPS = 2000;
const RETRY_INTERVAL = 50;

function retry(fn: () => void, retriesLeft = 10, interval = 100) {
function retry(fn: () => void, retriesLeft = 50, interval = 100) {
try {
return fn();
} catch (error) {
Expand Down Expand Up @@ -64,7 +63,7 @@ const useDisablePendoOnLanding = () => {
}

return () => {
if (interval && !isProd() && !isITLessEnv) {
if (interval && !isITLessEnv) {
clearInterval(interval);
}
};
Expand Down

0 comments on commit 29ca371

Please sign in to comment.