@daeryun/dr_components 1.2.93 → 1.2.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { useEffect, useRef } from 'react';
|
|
11
11
|
import * as gtag from '../../lib/gtag';
|
|
12
|
+
import { usePathname } from 'next/navigation';
|
|
12
13
|
/**
|
|
13
14
|
* 로그인 완료 후 URL에 uuid(idx)를 추가하고 GA 이벤트를 발생시키는 훅
|
|
14
15
|
* - 로그인된 상태이고, URL에 uuid가 없으면 uuid를 추가
|
|
@@ -16,6 +17,7 @@ import * as gtag from '../../lib/gtag';
|
|
|
16
17
|
*/
|
|
17
18
|
export const useLoginUuidSync = () => {
|
|
18
19
|
const hasProcessed = useRef(false);
|
|
20
|
+
const pathName = usePathname();
|
|
19
21
|
// console.log('useLoginUuidSync 훅 호출됨');
|
|
20
22
|
useEffect(() => {
|
|
21
23
|
// console.log('useLoginUuidSync useEffect 실행, hasProcessed:', hasProcessed.current);
|
|
@@ -74,6 +76,6 @@ export const useLoginUuidSync = () => {
|
|
|
74
76
|
}
|
|
75
77
|
});
|
|
76
78
|
syncUuid();
|
|
77
|
-
}, []);
|
|
79
|
+
}, [pathName]);
|
|
78
80
|
};
|
|
79
81
|
export default useLoginUuidSync;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
2
|
import * as gtag from '../../lib/gtag';
|
|
3
|
+
import { usePathname } from 'next/navigation';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* 로그인 완료 후 URL에 uuid(idx)를 추가하고 GA 이벤트를 발생시키는 훅
|
|
6
7
|
* - 로그인된 상태이고, URL에 uuid가 없으면 uuid를 추가
|
|
7
8
|
* - 로그인 완료 GA 이벤트 발생
|
|
8
9
|
*/
|
|
10
|
+
|
|
9
11
|
export const useLoginUuidSync = () => {
|
|
10
12
|
const hasProcessed = useRef(false);
|
|
13
|
+
const pathName = usePathname();
|
|
11
14
|
|
|
12
15
|
// console.log('useLoginUuidSync 훅 호출됨');
|
|
13
16
|
|
|
@@ -78,7 +81,7 @@ export const useLoginUuidSync = () => {
|
|
|
78
81
|
};
|
|
79
82
|
|
|
80
83
|
syncUuid();
|
|
81
|
-
}, []);
|
|
84
|
+
}, [pathName]);
|
|
82
85
|
};
|
|
83
86
|
|
|
84
87
|
export default useLoginUuidSync;
|