261102_07_FIX: 통화 중 새로고침 시 컨택 페이지 이탈 방지 및 CTI 송수신 로그 추가

This commit is contained in:
2026-11-02 18:28:43 +09:00
parent 72c8cdca37
commit 491b5a5e9f
3 changed files with 11 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
'use client'
import { Suspense, useEffect, useMemo, useState } from "react";
import { Suspense, useEffect, useMemo, useRef, useState } from "react";
import { useRouter, useSearchParams } from "next/navigation";
import { ArrowLeft, RefreshCw } from "lucide-react";
import { useMounted } from "@kri/common/hooks";
@@ -37,6 +37,7 @@ const ListContactPageContent = () => {
const userRole = auth?.user?.userRole ?? 0;
const ctiCallPhase = useCtiCallPhase();
const shouldBlockNavigation = CTI_CALL_PHASE.includes(ctiCallPhase);
const hasObservedCall = useRef(false);
const queriesEnabled = mounted && prjctIdx > 0;
const enabled = queriesEnabled && !!sid;
@@ -74,10 +75,12 @@ const ListContactPageContent = () => {
const hasGuardEntry = window.history.state?.[CALL_NAVIGATION_GUARD_KEY] === true;
if (!shouldBlockNavigation) {
if (hasGuardEntry) window.history.back();
if (hasGuardEntry && hasObservedCall.current) window.history.back();
hasObservedCall.current = false;
return;
}
hasObservedCall.current = true;
let isRestoringHistory = false;
if (!hasGuardEntry) {