From 5795f328a15c11b3e50b786909e538a71cce22c0 Mon Sep 17 00:00:00 2001 From: ByungCheol Date: Tue, 30 Jun 2026 21:44:12 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=95=B1=20=EC=9E=A0=EA=B8=88=20?= =?UTF-8?q?=EC=9C=A0=EC=98=88=EC=8B=9C=EA=B0=84=20=EB=8F=84=EC=9E=85=20?= =?UTF-8?q?=E2=80=94=20=EC=9E=A6=EC=9D=80=20PIN=20=EC=9E=85=EB=A0=A5=20?= =?UTF-8?q?=EB=B6=88=ED=8E=B8=20=ED=95=B4=EC=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 백그라운드 전환 즉시 잠그던 것을, 1시간 이상 백그라운드였을 때만 잠금 - 잠깐 다른 앱(계산기 등) 다녀오는 정도로는 PIN 안 뜸 - 완전 종료/재시작은 onMounted 에서 그대로 잠금 - 카메라/갤러리/공유 suppress 는 유지 Co-Authored-By: Claude Opus 4.8 --- src/App.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index d11e213..e79d3a6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -75,11 +75,19 @@ function retryReload() { } // ===== 앱 잠금(PIN) ===== -// 백그라운드로 가면 잠가서, 복귀 시 잠금 화면이 떠 있도록 한다. -// 단, 카메라/갤러리/공유 등 앱 내 네이티브 동작으로 인한 일시 숨김은 제외(suppress). +// 잠깐 다른 앱 다녀온 정도로는 잠그지 않고, 일정 시간 이상 백그라운드였을 때만 잠근다. +// (완전 종료/재시작은 onMounted 에서 잠금) — 카메라/갤러리/공유 등 인앱 동작은 suppress 로 제외. +const LOCK_GRACE_MS = 60 * 60 * 1000 // 1시간 미만 이탈은 잠그지 않음(잦은 PIN 입력 방지) +let backgroundedAt = 0 function onVisibility() { - if (document.hidden) appLock.lock() - else appLock.clearSuppress() // 복귀 — 일시중지 창 해제 + if (document.hidden) { + backgroundedAt = Date.now() + } else { + const away = backgroundedAt ? Date.now() - backgroundedAt : 0 + backgroundedAt = 0 + if (away >= LOCK_GRACE_MS) appLock.lock() // lock() 은 suppress 창이면 건너뜀 + appLock.clearSuppress() // 복귀 — 일시중지 창 해제 + } } // 파일 선택(input[type=file]) 클릭 시 다음 백그라운드 전환을 잠금에서 제외 function onFileInputClick(e) {