261013_03_ENH: bfcache CTI 재로그인 확인용 임시 로그 제거
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -43,30 +43,10 @@ export function useCtiConnection() {
|
||||
// 뒤로/앞으로 가기로 bfcache에 들어갔다가 돌아오면 React 상태가 그대로 복원되어 위 effect가 다시 실행되지 않는다.
|
||||
// 떠날 때 CTI 서버에 Logout, 돌아올 때 다시 Login 하여 새로고침 없이 전화걸기를 쓸 수 있게 한다.
|
||||
useEffect(() => {
|
||||
// TEMP_CTI_LOG: pagehide 시점 로그가 콘솔에 남지 않아, 떠날 때 정보를 sessionStorage에 남기고 돌아오거나 다시 로드될 때 출력한다.
|
||||
const PAGEHIDE_DEBUG_KEY = "__cti_pagehide_debug"; // TEMP_CTI_LOG
|
||||
const printLastPageHide = (from: string) => {
|
||||
const saved = sessionStorage.getItem(PAGEHIDE_DEBUG_KEY);
|
||||
if (!saved) return;
|
||||
console.log(`[CTI][TEMP_LOG] last pagehide (${from}) ->`, JSON.parse(saved)); // TEMP_CTI_LOG
|
||||
sessionStorage.removeItem(PAGEHIDE_DEBUG_KEY);
|
||||
};
|
||||
printLastPageHide("mount");
|
||||
console.log("[CTI][TEMP_LOG] page lifecycle listeners registered"); // TEMP_CTI_LOG
|
||||
|
||||
const handlePageHide = (event: PageTransitionEvent) => {
|
||||
console.log("[CTI][TEMP_LOG] pagehide, persisted =", event.persisted); // TEMP_CTI_LOG
|
||||
sessionStorage.setItem(PAGEHIDE_DEBUG_KEY, JSON.stringify({
|
||||
persisted: event.persisted,
|
||||
at: new Date().toISOString(),
|
||||
path: window.location.pathname,
|
||||
connectionState: ctiClient.getConnectionState(),
|
||||
})); // TEMP_CTI_LOG
|
||||
if (event.persisted) ctiClient.suspendForPageHide();
|
||||
};
|
||||
const handlePageShow = (event: PageTransitionEvent) => {
|
||||
console.log("[CTI][TEMP_LOG] pageshow, persisted =", event.persisted); // TEMP_CTI_LOG
|
||||
printLastPageHide("pageshow");
|
||||
if (event.persisted) ctiClient.resumeFromPageShow();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user