Skip to content

Commit

Permalink
fix : usEffect return 문 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
guesung committed Nov 15, 2023
1 parent 93ab849 commit a2a9e53
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/app/[lng]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export default function Home() {
const { replace } = useAppRouter();
const isapp = getIsApp();

useEffect(() => {
useDidMount(() => {
if (!isapp) return;
const listener = (event: any) => {
const listener = async (event: any) => {
const { data, type } = JSON.parse(event.data);
copyToClipboard(data);
await copyToClipboard(data);
switch (type) {
case 'FCM_TOKEN':
postFCMToken({ token: data });
Expand All @@ -29,11 +29,7 @@ export default function Home() {

document.addEventListener('message', listener);
window.addEventListener('message', listener);
return () => {
document.removeEventListener('message', listener);
window.removeEventListener('message', listener);
};
}, [isapp]);
});

useDidMount(async () => {
const cookieLanguage = getLocalCookie(cookieName);
Expand Down

0 comments on commit a2a9e53

Please sign in to comment.