Skip to content

Commit

Permalink
Mer debug 😡
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbjoern committed Nov 20, 2023
1 parent d0c4703 commit 02219b0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@ const Index = ({ søknader }: { søknader: Søknad[] }) => {
useEffect(() => {
if (sisteSøknad != undefined && sisteSøknad.innsendtDato != undefined) {
const erEldreEnn14Uker = isBefore(new Date(sisteSøknad.innsendtDato), sub(new Date(), { weeks: 14 }));
if (erEldreEnn14Uker && Object.hasOwn(window, 'hj')) {
// @ts-ignore-line
window?.hj('trigger', 'aap_brev_undersokelse');
if (erEldreEnn14Uker) {
setTimeout(() => {
// @ts-ignore-line
if (typeof window.hj === 'function') {
// @ts-ignore-line
window?.hj('trigger', 'aap_brev_undersokelse');
} else {
console.log('hotjar ble ikke lastet inn i tide :(');
}
}, 1000);
} else {
console.log('Siste søknad er ikke eldre enn 14 uker');
}
Expand Down

0 comments on commit 02219b0

Please sign in to comment.