Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Logger
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-nom committed Dec 16, 2022
1 parent c2fea32 commit 7a49889
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/komponenter/header/common/godjul/GodJul.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useEffect, useState } from 'react';
import { logAmplitudeEvent } from '../../../../utils/analytics/amplitude';

import style from './GodJul.module.scss';

Expand All @@ -15,17 +16,14 @@ export const GodJul = () => {
if (keysPressed.join('') === 'godjul') {
setIsEnabled(true);
document.removeEventListener('keydown', handler);
console.log('God jul!');
logAmplitudeEvent('godjul');
}
};

document.addEventListener('keydown', handler);

console.log('Added event listener');

return () => {
window.removeEventListener('keydown', handler);
console.log('Removed event listener');
};
}, []);

Expand Down

0 comments on commit 7a49889

Please sign in to comment.