diff --git a/static/app.js b/static/app.js index b4b6d41..c68a865 100644 --- a/static/app.js +++ b/static/app.js @@ -1104,11 +1104,17 @@ createApp({ } async function duplicateLine(line) { - if (line.geometry_resolved === false) return; + if (line.geometry_resolved === false) { + addEvent(`DUPLICATE #${line.number} FAILED · no source geometry`, 'error'); + return; + } const anchorT = shiftTimeByBars(line, line.anchor_t); const endT = shiftTimeByBars(line, line.last_t); const cutoffT = line.cutoff_t == null ? null : shiftTimeByBars(line, line.cutoff_t); - if (anchorT == null || endT == null || (line.cutoff_t != null && cutoffT == null)) return; + if (anchorT == null || endT == null || (line.cutoff_t != null && cutoffT == null)) { + addEvent(`DUPLICATE #${line.number} FAILED · cannot shift 10 bars`, 'error'); + return; + } const endP = line.anchor_p + line.slope * (line.last_t - line.anchor_t); const response = await apiFetch('/api/lines', { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -1123,7 +1129,7 @@ createApp({ }), }); if (!response.ok) { - console.error(`Unable to duplicate line: HTTP ${response.status}`); + addEvent(`DUPLICATE #${line.number} FAILED · HTTP ${response.status}`, 'error'); return; } const saved = await response.json();