From 4fd52bf8fc593ae0f126482a325aa26f9196ffcd Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Wed, 28 Oct 2026 16:50:10 +0900 Subject: [PATCH 1/8] =?UTF-8?q?261028=5F01=5FENH:=20CTI=20=ED=86=B5?= =?UTF-8?q?=ED=99=94=20=EC=9E=AC=EC=97=B0=EA=B2=B0=20=EB=B3=B5=EC=9B=90=20?= =?UTF-8?q?=EB=8C=80=EC=9D=91=20=EB=B0=8F=20=EC=A2=85=EB=A3=8C=20=EC=9A=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=B2=98=EB=A6=AC=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Talking 재수신 시 기존 통화 세션 복원 - 재로그인 상태 11인 종료 누락 통화를 기존 API로 정리 - 정상 종료 선반영 및 3초 강제 재연결 제거 - 종료 요청 대기·재시도와 중복 이벤트·지연 응답 처리 보완 --- .../list-contact/ListContactInfoPanel.tsx | 18 +- src/const/ctiConst.ts | 12 +- src/lib/cti/ctiClient.ts | 908 +++++++++--------- 3 files changed, 491 insertions(+), 447 deletions(-) diff --git a/src/components/list-contact/ListContactInfoPanel.tsx b/src/components/list-contact/ListContactInfoPanel.tsx index 6dff3fe..5c04950 100644 --- a/src/components/list-contact/ListContactInfoPanel.tsx +++ b/src/components/list-contact/ListContactInfoPanel.tsx @@ -62,15 +62,17 @@ const disabledContrastClass = 'bg-white disabled:opacity-100 disabled:text-foreg // disabled는 공용 Input 컴포넌트의 disabled:pointer-events-none 때문에 마우스 이벤트 자체를 못 받는다. const readOnlyContrastClass = 'bg-white read-only:text-foreground read-only:bg-muted/60' -const getCallButtonLabel = (isDialing: boolean, isOnCall: boolean) => { +const getCallButtonLabel = (isDialing: boolean, isOnCall: boolean, isEnding: boolean) => { + if (isEnding) return '종료 요청 중' if (isDialing) return '거는 중' if (isOnCall) return '전화 끊기' return '전화' } -const getCallButtonTitle = (isCtiReady: boolean, isDialing: boolean) => { +const getCallButtonTitle = (isCtiReady: boolean, isDialing: boolean, isEnding: boolean) => { if (!isCtiReady) return '전화 시스템에 연결되어 있지 않습니다.' if (isDialing) return '전화를 거는 중입니다.' + if (isEnding) return '통화 종료를 확인하고 있습니다.' return undefined } @@ -114,7 +116,8 @@ const ListContactInfoPanel = ({ const isCtiReady = ctiConnectionStatus === 'open' const ctiCallPhase = useCtiCallPhase() const isDialing = ctiCallPhase === 'dialing' - const isOnCall = ctiCallPhase === 'active' + const isEnding = ctiCallPhase === 'ending' + const isOnCall = ctiCallPhase === 'active' || isEnding const visibleHeaders = listHeaders .filter((header) => isListFieldVisibleForContact(header)) @@ -147,8 +150,7 @@ const ListContactInfoPanel = ({ } const handleCall = (telNum: string, listHderId: number) => { - if (!isCtiReady || isDialing) return - // CTI_HANGUP_PENDING_VENDOR: 외주사 Hangup 명령 동작 확인 후 통화 중 버튼을 활성화하면 즉시 사용할 수 있다. + if (!isCtiReady || isDialing || isEnding) return if (isOnCall) { ctiClient.hangup() return @@ -228,12 +230,12 @@ const ListContactInfoPanel = ({ type="button" variant="outline" className={cn('shrink-0 gap-2', isOnCall && 'bg-accent text-accent-foreground')} - disabled={isEditing || !isCtiReady || isDialing} - title={getCallButtonTitle(isCtiReady, isDialing)} + disabled={isEditing || !isCtiReady || isDialing || isEnding} + title={getCallButtonTitle(isCtiReady, isDialing, isEnding)} onClick={() => handleCall(value, header.listHderId)} > - {getCallButtonLabel(isDialing, isOnCall)} + {getCallButtonLabel(isDialing, isOnCall, isEnding)} + {targetUrl ? ( + + ) : ( + + )} ); })} )} - {redirectUrlEnabled && redirectUrlQuery.isError ? ( -
- 설문 현황 링크를 불러오지 못했습니다. - -
- ) : null} - - {openedUrl ? ( -

- 새 창에서 열립니다. 열리지 않았다면{" "} - - 여기 - - 를 클릭해 주세요. -

- ) : null} ); }; diff --git a/src/app/api/kart/[[...slug]]/route.ts b/src/app/api/kart/[[...slug]]/route.ts index 5cb7db0..0360160 100644 --- a/src/app/api/kart/[[...slug]]/route.ts +++ b/src/app/api/kart/[[...slug]]/route.ts @@ -24,28 +24,6 @@ export const GET = async (req: NextRequest, context: RouteContext) => { return NextResponse.json(result, { status: 200 }); } - if(action === "survey-redirect-url" && slug.length === 3){ - const [, isKiwi, pkey] = slug; - if (!["0", "1"].includes(isKiwi)) { - return NextResponse.json({ message: "프로젝트 정보를 확인해 주세요." }, { status: 400 }); - } - - // Contact backend를 거쳐 KON/KIWI 현황 공유 링크를 발급한다. - const result = await contactApi.post( - `/kart/project/${isKiwi}/${encodeURIComponent(pkey)}/share`, - {}, - { expectText: true }, - ); - const shortUrl = typeof result === "string" && /^https?:\/\//.test(result) - ? result - : null; - if (!shortUrl) { - return NextResponse.json({ message: "KART 공유 링크 응답을 확인해 주세요." }, { status: 502 }); - } - - return NextResponse.json(shortUrl, { status: 200 }); - } - return NextResponse.json({ message: "Not found" }, { status: 404 }); } catch (error: unknown) { return errorToResponse(error); diff --git a/src/lib/env.client.ts b/src/lib/env.client.ts index eabf169..545985c 100644 --- a/src/lib/env.client.ts +++ b/src/lib/env.client.ts @@ -3,6 +3,8 @@ import { createEnv, env } from "@kri/common/config"; export const clientEnv = createEnv({ ENV: env.required("NEXT_PUBLIC_ENV", process.env.NEXT_PUBLIC_ENV), + KART_URL: env.required("NEXT_PUBLIC_KART_URL", process.env.NEXT_PUBLIC_KART_URL), + API_BASE: env.required("NEXT_PUBLIC_API_BASE", process.env.NEXT_PUBLIC_API_BASE), API_INTERNAL: env.required("NEXT_PUBLIC_API_INTERNAL", process.env.NEXT_PUBLIC_API_INTERNAL), diff --git a/src/query/key/keys.ts b/src/query/key/keys.ts index 6f43e80..c044d46 100644 --- a/src/query/key/keys.ts +++ b/src/query/key/keys.ts @@ -38,8 +38,6 @@ export const qk = { /********** KON, KIWI 프로젝트 관련 KART에서 받아옴 **********/ kartProjectList: (itrntPrjctCd: string, userTeam: string, isKiwi: number, keyword: string) => ["kart", "project-list", itrntPrjctCd, userTeam, isKiwi, keyword] as const, - surveyRedirectUrl: (isKiwi: number, pkey: string) => - ["kart", "survey-redirect-url", isKiwi, pkey] as const, /********** KON, KIWI 프로젝트 관련 KART에서 받아옴 **********/ /********** 찐 인트라넷 관련 **********/ diff --git a/src/query/project.ts b/src/query/project.ts index 18ad9fb..e76c9ae 100644 --- a/src/query/project.ts +++ b/src/query/project.ts @@ -131,19 +131,6 @@ export function useKartProjectListQuery(args: { }); } -/** - * KON/KIWI 설문 현황(리포트) 바로가기 URL - */ -export function useSurveyRedirectUrlQuery(isKiwi: number, pkey: string, enabled: boolean) { - return useQuery({ - queryKey: qk.surveyRedirectUrl(isKiwi, pkey), - queryFn: () => nextApi.get(`/kart/survey-redirect-url/${isKiwi}/${encodeURIComponent(pkey)}`, { skipForbiddenHandler: true }), - enabled: enabled && !!pkey, - staleTime: 0, - meta: { ignoreGlobalLoading: true }, - }); -} - /** * 프로젝트에 배정된 회사 ID 목록 */ -- 2.49.0.windows.1 From bfde326316b4deaf4448be65b618f8334a11d048 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Mon, 2 Nov 2026 16:07:54 +0900 Subject: [PATCH 6/8] =?UTF-8?q?261102=5F05=5FENH:=20=ED=99=98=EA=B2=BD?= =?UTF-8?q?=EB=B3=80=EC=88=98=20public=EB=81=BC=EB=A6=AC=20=EB=AA=A8?= =?UTF-8?q?=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.local | 2 +- .env.production | 2 +- AGENTS.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 3 deletions(-) diff --git a/.env.development b/.env.development index d907ffc..8f818ca 100644 --- a/.env.development +++ b/.env.development @@ -1,9 +1,9 @@ NEXT_PUBLIC_ENV=dev NEXT_PUBLIC_API_BASE=https://test-contact.kric.com/api +NEXT_PUBLIC_KART_URL=https://test-kart.kric.com ENV=dev CONTACT_SERVER=http://127.0.0.1:4001 API_CONTACT_SERVER=http://127.0.0.1:4001/api/v1 API_INTRANET_SERVER=https://intranet-ext.kric.com/api/v1 AUTH_COOKIE_DOMAIN=kric.com -NEXT_PUBLIC_KART_URL=https://test-kart.kric.com diff --git a/.env.local b/.env.local index df8d09e..e097257 100644 --- a/.env.local +++ b/.env.local @@ -1,8 +1,8 @@ NEXT_PUBLIC_ENV=local NEXT_PUBLIC_API_BASE=http://localhost:4000/api +NEXT_PUBLIC_KART_URL=https://test-kart.kric.com ENV=local CONTACT_SERVER=http://localhost:4001 API_CONTACT_SERVER=http://localhost:4001/api/v1 API_INTRANET_SERVER=https://intranet-ext.kric.com/api/v1 -NEXT_PUBLIC_KART_URL=https://test-kart.kric.com diff --git a/.env.production b/.env.production index afd6cd1..b98909b 100644 --- a/.env.production +++ b/.env.production @@ -1,9 +1,9 @@ NEXT_PUBLIC_ENV=prod NEXT_PUBLIC_API_BASE=https://contact.kric.com/api +NEXT_PUBLIC_KART_URL=https://kart.kric.com ENV=prod CONTACT_SERVER=http://127.0.0.1:4001 API_CONTACT_SERVER=http://127.0.0.1:4001/api/v1 API_INTRANET_SERVER=https://intranet-ext.kric.com/api/v1 AUTH_COOKIE_DOMAIN=kric.com -NEXT_PUBLIC_KART_URL=https://kart.kric.com diff --git a/AGENTS.md b/AGENTS.md index 294aaa2..667b1ed 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -229,6 +229,7 @@ When implementation is complete, report in Korean: - Treat the current React version, component style, state management, routing, styling, and test approach as authoritative. - Do not perform unrelated class-to-hook, JavaScript-to-TypeScript, state-library, styling-system, or React-to-Next.js migrations. - Keep components focused and follow the repository's established split between presentation, state, data access, and side effects. +- Do not use nested ternary expressions. Use clear `if`/`else` branches, early returns, or well-named intermediate variables instead; a single, non-nested ternary is acceptable only when it remains immediately readable. - Keep effects dependency-correct and clean up subscriptions, timers, listeners, and in-flight work where applicable. - Use stable semantic keys and preserve accessibility, loading, empty, error, disabled, and success states. - Preserve public component props and shared UI contracts unless a coordinated breaking change is explicitly approved. @@ -265,6 +266,35 @@ Before each related task, read the current contents of every matching reference, If a task spans multiple scopes, read every matching reference. Generated files under `.agent-harness/references/` are read-only copies; edit KriFrontCommon's `.agent/consumer.md` or `.agent/consumer-references/` and recompose instead. +## Noti-hub SMS Types + +- `MessageType.SMS = 21`, `LMS = 22`, `MMS = 23`; `ChannelType.SMS = 2` is unchanged. `SMS_TYPE_ARRAY` and `SmsType` include all three. +- `LMS_MMS = 22` remains a deprecated source-compatibility alias for LMS only. It does not represent MMS. Enum reverse lookup for 22 returns LMS. Use numeric bulk-list paths; the server no longer accepts LMS_MMS in paths. Numeric 21/22/23 bulk-list requests all return the entire SMS channel, not type-filtered lists. +- Requests retain their existing URLs/body shapes. The server chooses the actual type per recipient after substitution: attachment -> MMS; otherwise title or UTF-8 body >= 90 bytes -> LMS; otherwise SMS. +- Refresh templates from the save response (`tmplatTy`); display actual delivery types from `sendTy`, not the template or result code. A bulk can contain multiple SMS types. LMS/MMS share result codes; use existing server result labels. +- SMS, LMS, MMS and KKO use cancellation code 9998. Verify with `npm run typecheck`, `npm run build`, and `node --test tests/noti-hub-sms.test.mjs`. + +## Noti-hub Reservation Cancellation + +- Import cancellation types, constants, and helpers from `@kri/common/noti-hub` only. They are runtime-neutral and require no optional peers. +- Individual current cancellation state is determined by resultCode via isReserveCanceledResult; bulk current state is cancellationStatus (NONE/PARTIAL/ALL). These describe current cancellation state, not cancellation eligibility. cancelDt and cancelUser are request history, not current state. +- SendResultInfo, SendInfo, and BulkSendInfo expose optional cancelable. Use isSendCancelable(item), which returns true only for cancelable === true, for cancellation eligibility; missing values from older responses are treated as false. Never infer eligibility from cancelDt, result labels, or result codes. +- cancelable reflects query-time state and may change before cancellation. Determine the final outcome from SendCancelResponse counts. +- sendIdx is the single-cancel identifier, not cmid. It is absent from the latest abbreviated report (/api/v1/report/last/send/...). Request sendIdx must be a positive integer; bulkSendKey is required and at most 32 characters. +- EMAIL_RESERVE_CANCELED_RESULT_CODE is 108 for EMAIL. SMS_KKO_RESERVE_CANCELED_RESULT_CODE is 9998 for SMS, LMS, MMS, and KKO. Unknown message types are not recognized as canceled. +- Display the server's resultViewLabel/resultLabel ("예약 취소"). There is no separate result-code list API. +- HTTP 200 can contain notCancelableCount. parseSendCancelResponse validates nonnegative integer counts and targetCount = canceledCount + alreadyCanceledCount + notCancelableCount, throwing TypeError on invalid data. Bulk targetCount counts currently registered detail rows; response canceledCount counts only cancellations made by that request. +- Existing response fields are unchanged; all added fields on existing types are optional. Verify with npm run typecheck and npm run build. + +## HTTP Streaming + +- `@kri/common/http` HTTP clients expose streamGet/streamPost/streamPut/streamPatch/streamDel, returning HttpStreamResponse (status, statusText, headers, url, nullable body). +- Streaming shares ordinary authentication, URL, body and HTTP-error policy. Read body incrementally; no automatic JSON/NDJSON/SSE parsing or reconnect is performed. +- Streaming options accept an external AbortSignal. Caller cancellation raises AbortError without an HTTP error notification. Cancel the body when it will not be consumed. +- timeoutMs covers connection/headers (and an HTTP error body); idleTimeoutMs covers inactivity after successful headers and resets on consumed chunks. Both default to the client's defaultTimeoutMs (60 seconds by default), and 0 disables that timer for streaming only. +- Mid-stream transport/time-out errors reach the body reader. HTTP error statuses use existing HttpError handlers before a stream is returned. A 204 response has body=null. +- See HTTP_STREAMING.md for examples and node --test tests/http-stream.test.mjs for focused validation after npm run build. + ## KriUiRegistry Consumer Contract When implementing or changing frontend UI, use this order: @@ -274,6 +304,28 @@ When implementing or changing frontend UI, use this order: 3. Otherwise, prefer a suitable shadcn/ui component. 4. Create a custom component only when the preceding options cannot meet the requirement safely. +### KriAutoComplete Search Scroll + +- `kri-auto-complete` exposes `resetScrollOnSearch?: boolean` on `KriSingleSelect`, `KriMultiSelect`, and `MultiSelect`. It defaults to `false`, preserving existing behavior. +- When enabled, a search value change (including clearing it) resets the option list scroll to the top on the next animation frame in both `filter` and `inputOnly` modes. Async result updates alone do not trigger another reset. + +### KriAutoComplete Option Tooltip + +- `kri-auto-complete` exposes `optionTooltip?: 'singleLine' | 'wrap'` and `optionTooltipClassName?: string` on `KriSingleSelect`, `KriMultiSelect`, and `MultiSelect`. It is off by default, preserving existing behavior. +- When enabled, hovering an option shows its full `label` in a right-side tooltip. `singleLine` stays on one line until the available viewport width; `wrap` wraps at 28rem. The item depends on the shadcn `tooltip` component and provides its own `TooltipProvider`. + +### KriAutoComplete Search Match + +- `kri-auto-complete` exposes `searchMatch?: 'fuzzy' | 'contains'` on `KriSingleSelect`, `KriMultiSelect`, and `MultiSelect`. It defaults to `fuzzy` (cmdk's default subsequence scoring), preserving existing behavior. +- `contains` keeps only options whose label or value contains the search text as a case-insensitive substring, in the original option order. It applies only when `searchMode` is `filter`. + +### KriEditor SMS Preview + +- `changeSmsType` reports `SMS | LMS | MMS`. Update consumer callbacks to handle `MMS`; this widens the previous callback contract. +- Attachment presence (`smsHasAttachment`) takes priority and reports MMS. Otherwise a title or UTF-8 preview size >= `smsMaxBytes` (default 90) reports LMS; the remainder reports SMS. LMS/MMS share `lmsMaxBytes` (default 2000). +- UTF-8 byte counting includes `smsPreviewSuffix` and its separating newline, without storing the suffix in the body. +- This is a preview. Use the template-save response for saved `tmplatTy` and delivery-result `sendTy` for actual per-recipient type after server substitution. Registry updates require updating installed consumer copies. + ### Required Shared References Before each related task, read the current contents of every matching reference, even if it was read earlier in the session. -- 2.49.0.windows.1 From ff9968db2e7be4d8ee27bc6780aad7b5d8637767 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Mon, 2 Nov 2026 17:10:44 +0900 Subject: [PATCH 7/8] =?UTF-8?q?261102=5F06=5FENH:=20=EB=A9=94=EC=8B=9C?= =?UTF-8?q?=EC=A7=80=20=ED=85=9C=ED=94=8C=EB=A6=BF=20=EC=A0=9C=EB=AA=A9?= =?UTF-8?q?=C2=B7=ED=85=9C=ED=94=8C=EB=A6=BF=EB=AA=85=C2=B7=EB=B0=9C?= =?UTF-8?q?=EC=8B=A0=EC=9E=90=EB=AA=85=EC=97=90=20=EB=8B=A4=EA=B5=AD?= =?UTF-8?q?=EC=96=B4=20=EC=9E=85=EB=A0=A5=20=ED=97=88=EC=9A=A9=20(?= =?UTF-8?q?=EC=9D=B4=EB=AA=A8=EC=A7=80=20=EC=A0=9C=EC=99=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/message-template/MessageTemplate.tsx | 8 ++++---- src/const/validationConst.ts | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/message-template/MessageTemplate.tsx b/src/components/message-template/MessageTemplate.tsx index 9346f5c..ba29bfd 100644 --- a/src/components/message-template/MessageTemplate.tsx +++ b/src/components/message-template/MessageTemplate.tsx @@ -34,7 +34,7 @@ import { downloadFile } from "@kri/common/browser"; import {cn} from "@/lib/utils"; import {ProjectMainTemplateUpdateRequest, ProjectSurvey} from "@/types/project"; import type { DataVerification } from "@kri/common"; -import {COMMON_TEXT_REGEX, EMAIL_REGEX} from "@/const/validationConst"; +import {COMMON_TEXT_REGEX, EMAIL_REGEX, TEMPLATE_TEXT_REGEX} from "@/const/validationConst"; import {formatKoreanPhoneNumber} from "@/utils/phone"; import { getTemplateAttachmentNames, @@ -244,15 +244,15 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) = if (isBlank(tpl.itrntPrjctCd)) return fail("itrntPrjctCd", "인트라넷 프로젝트 코드가 없습니다."); if (isBlank(tpl.tmplatNm)) return fail("tmplatNm", "템플릿명을 입력해 주세요."); if (tpl.tmplatNm.length > 32) return fail("tmplatNm", "템플릿명은 32자 이하로 입력해주세요."); - if (!COMMON_TEXT_REGEX.test(tpl.tmplatNm)) return fail("tmplatNm", "템플릿명에 허용되지 않는 문자가 포함되어 있습니다."); + if (!TEMPLATE_TEXT_REGEX.test(tpl.tmplatNm)) return fail("tmplatNm", "템플릿명에 허용되지 않는 문자가 포함되어 있습니다."); if (isBlank(tpl.tmplatBody)) return fail("tmplatBody", "본문을 입력해 주세요."); if (isBlank(tpl.sendNm)) return fail("sendNm", "발신자명을 입력해 주세요."); if (tpl.sendNm.length > 32) return fail("sendNm", "발신자명은 32자 이하로 입력해주세요."); - if (!COMMON_TEXT_REGEX.test(tpl.sendNm)) return fail("sendNm", "발신자명에 허용되지 않는 문자가 포함되어 있습니다."); + if (!TEMPLATE_TEXT_REGEX.test(tpl.sendNm)) return fail("sendNm", "발신자명에 허용되지 않는 문자가 포함되어 있습니다."); if (!isBlank(tpl.tmplatTitle)) { if (tpl.tmplatTitle!.length > 128) return fail("tmplatTitle", "제목은 128자 이하로 입력해주세요."); - if (!COMMON_TEXT_REGEX.test(tpl.tmplatTitle!)) return fail("tmplatTitle", "제목에 허용되지 않는 문자가 포함되어 있습니다."); + if (!TEMPLATE_TEXT_REGEX.test(tpl.tmplatTitle!)) return fail("tmplatTitle", "제목에 허용되지 않는 문자가 포함되어 있습니다."); } if (tpl.tmplatTy === MessageType.EMAIL) { diff --git a/src/const/validationConst.ts b/src/const/validationConst.ts index 84b0d3f..2e647f8 100644 --- a/src/const/validationConst.ts +++ b/src/const/validationConst.ts @@ -6,6 +6,14 @@ // 그 외 문자(이모지, 다른 언어 문자, 제어문자 등)는 전부 거부한다. export const COMMON_TEXT_REGEX = /^[가-힣A-Za-z0-9 !@#$%^&*()_+\-={}\[\]:;"'<>,.?/·~]+$/ +// 메시지 템플릿의 제목·템플릿명·발신자명용. 다국어(스페인어, 일본어 등)와 기호는 허용하고 +// 제어·서식 문자, 줄/문단 구분자, 이모지만 거부한다. +// tsconfig target(ES2017)에서 \p{...} 리터럴 대신 RegExp 생성자로 만든다. +export const TEMPLATE_TEXT_REGEX = new RegExp( + "^[^\\p{C}\\p{Zl}\\p{Zp}\\p{Emoji_Presentation}\\u{FE0F}\\u{20E3}]+$", + "u", +) + // 이메일 기본 형식(로컬@도메인.최상위도메인)만 확인한다. 세부 규칙은 백엔드 검증을 따른다. export const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/ -- 2.49.0.windows.1 From 491b5a5e9fc1e1fa4f9811bd356cf52e5f892bfb Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Mon, 2 Nov 2026 18:28:43 +0900 Subject: [PATCH 8/8] =?UTF-8?q?261102=5F07=5FFIX:=20=ED=86=B5=ED=99=94=20?= =?UTF-8?q?=EC=A4=91=20=EC=83=88=EB=A1=9C=EA=B3=A0=EC=B9=A8=20=EC=8B=9C=20?= =?UTF-8?q?=EC=BB=A8=ED=83=9D=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=9D=B4?= =?UTF-8?q?=ED=83=88=20=EB=B0=A9=EC=A7=80=20=EB=B0=8F=20CTI=20=EC=86=A1?= =?UTF-8?q?=EC=88=98=EC=8B=A0=20=EB=A1=9C=EA=B7=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.local | 1 + src/app/(pages)/(main)/list/contact/page.tsx | 7 +++++-- src/lib/cti/ctiClient.ts | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.env.local b/.env.local index e097257..e1d2d30 100644 --- a/.env.local +++ b/.env.local @@ -6,3 +6,4 @@ ENV=local CONTACT_SERVER=http://localhost:4001 API_CONTACT_SERVER=http://localhost:4001/api/v1 API_INTRANET_SERVER=https://intranet-ext.kric.com/api/v1 +AUTH_COOKIE_DOMAIN= \ No newline at end of file diff --git a/src/app/(pages)/(main)/list/contact/page.tsx b/src/app/(pages)/(main)/list/contact/page.tsx index b62ba82..c33fd72 100644 --- a/src/app/(pages)/(main)/list/contact/page.tsx +++ b/src/app/(pages)/(main)/list/contact/page.tsx @@ -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) { diff --git a/src/lib/cti/ctiClient.ts b/src/lib/cti/ctiClient.ts index 7ac6cca..940012f 100644 --- a/src/lib/cti/ctiClient.ts +++ b/src/lib/cti/ctiClient.ts @@ -756,6 +756,7 @@ const send = (command: Record): boolean => { if (!socket || socket.readyState !== WebSocket.OPEN) return false; try { socket.send(JSON.stringify(command)); + console.log("[CTI][TEMP_LOG] send ->", command); // TEMP_CTI_LOG return true; } catch { return false; @@ -817,7 +818,10 @@ const openSocketAndLogin = (params: CtiLoginParams) => { AgentGroup: CTI_AGENT_GROUP, ANINumber: params.aniNumber, AgentPhone: params.agentPhone }); }; ws.onmessage = (event) => { - if (socket === ws) handleIncomingMessage(event.data); + if (socket === ws) { + console.log("[CTI][TEMP_LOG] message <-", event.data); // TEMP_CTI_LOG + handleIncomingMessage(event.data); + } }; ws.onerror = () => console.warn("[CTI] WebSocket 연결 오류"); ws.onclose = () => { -- 2.49.0.windows.1