fix(B07): 계획평면도 [업데이트] 뒤 보던 장에 그대로 머뭄(73-8)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPJGtfXo6GMbcpiboQC4uK
This commit is contained in:
@@ -78,6 +78,9 @@ function L(key: keyof typeof ui_locales): string {
|
||||
/* -----------------------------------------------------------------------------
|
||||
* 화면 조립
|
||||
* -------------------------------------------------------------------------- */
|
||||
/** 종류 · 대피소 자리를 고쳐 화면을 다시 세울 때 — 보던 장 id. 다시 세운 뒤 그 장을 연다(없으면 첫 장). */
|
||||
let reopenDrawingId: string | undefined;
|
||||
|
||||
export async function renderB07DesignDetail(root: HTMLElement): Promise<void> {
|
||||
const projectId = localStorage.getItem(CURRENT_PROJECT_ID_KEY);
|
||||
let workflowState: WorkflowState | undefined;
|
||||
@@ -437,6 +440,7 @@ export async function renderB07DesignDetail(root: HTMLElement): Promise<void> {
|
||||
// 종류 · 대피소 자리를 고쳤다 — 목록 · 도면을 서버에서 다시 받아 화면을 다시 세운다.
|
||||
onChanged: () => {
|
||||
if (!mayDiscardEdits()) return;
|
||||
reopenDrawingId = currentDrawing?.id;
|
||||
cad.destroy();
|
||||
void renderB07DesignDetail(root);
|
||||
},
|
||||
@@ -485,7 +489,10 @@ export async function renderB07DesignDetail(root: HTMLElement): Promise<void> {
|
||||
// 페이지 진입 시 첫 도면(종단도)을 자동 선택 — 빈 CAD 화면 방지.
|
||||
// CAD가 아직 준비 전이면 cad.load 가 붙들고 있다가 ready 때 보낸다.
|
||||
if (drawings.length > 0) {
|
||||
void loadDrawing(drawings[0], 0).then(() => {
|
||||
const reopen = drawings.findIndex((item) => item.id === reopenDrawingId);
|
||||
reopenDrawingId = undefined;
|
||||
const first = Math.max(reopen, 0);
|
||||
void loadDrawing(drawings[first], first).then(() => {
|
||||
// 첫 장을 띄운 뒤에 나머지를 받는다 — 진입 속도를 뺏지 않는다.
|
||||
void prefetchAllDrawings();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user