summaryrefslogtreecommitdiff
path: root/src/SomhairlesDream.Frontend
diff options
context:
space:
mode:
Diffstat (limited to 'src/SomhairlesDream.Frontend')
-rw-r--r--src/SomhairlesDream.Frontend/App.fs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/SomhairlesDream.Frontend/App.fs b/src/SomhairlesDream.Frontend/App.fs
index f9184c5..ec9e273 100644
--- a/src/SomhairlesDream.Frontend/App.fs
+++ b/src/SomhairlesDream.Frontend/App.fs
@@ -662,6 +662,19 @@ let selectedRun () =
TargetId = inputValue "target-id-input"
Render = (element "run-render-input" :?> HtmlInput).``checked`` }
+// The boot run id names a pre-published historical replay that already has an
+// on-disk manifest; re-running it can only fail ("run directory already
+// exists"). A user submit keeps their typed ids unless they left the boot
+// default untouched — then pick a fresh live run id instead.
+let freshLiveRunId (base_: string) =
+ sprintf "%s-live-%d" base_ (int (JS.Constructors.Date.now () % 1000000.0))
+
+let selectionForLiveStart (selection: RunSelection) =
+ if selection.RunId = "run-probe-real-2" then
+ { selection with RunId = freshLiveRunId selection.RunId }
+ else
+ selection
+
let startRun (selection: RunSelection) =
let requestBody =
createObj
@@ -762,7 +775,7 @@ let boot () =
(element "viewport-note").addEventListener("click", fun _ -> retryFailedLoad ())
(element "run-controls").addEventListener("submit", fun event ->
event.preventDefault()
- startRun (selectedRun ()))
+ startRun (selectionForLiveStart (selectedRun ())))
loadBootHistory ()