feat(M01): 저장 뒤 새 줄은 서버가 준 키(added)로 엶

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016PSXsvyDxjNmufteN5bqmt
This commit is contained in:
2026-10-01 23:46:37 +09:00
co-authored by Claude Opus 5.5
parent 8a42a7fe75
commit 0d45014e38
+6 -6
View File
@@ -394,16 +394,16 @@ export async function mountM01LogicLab(
}
showLoadingOverlay();
try {
await saveFiles([...byFile.values()]);
// 키 없는 새 줄은 서버가 새 키를 줌(added) — 저장 뒤 그 로직을 엶
const saved = (await saveFiles([...byFile.values()])) as {
added?: { file: string; key: string }[];
};
const was = opened;
const before = new Set(allLogics.map((x) => x.키));
drafts = {};
await reload();
showToast(tx("Save_Done"), "success");
const made =
was?.row && !was.row.키
? allLogics.find((x) => !before.has(x.키) && x.이름 === was.row?.이름)
: undefined;
const newKey = was?.row && !was.row.키 ? saved.added?.at(-1)?.key : undefined;
const made = newKey ? allLogics.find((x) => x.키 === newKey) : undefined;
if (made) await open(logicId(made.구분, made.키), made.구분, made.키);
else if (was?.row?.키) await open(logicId(was.sub, was.row.키), was.sub, was.row.키);
else show(null);