feat: enable mock specific files located in the public/mock folder

This commit is contained in:
Li Xin 2025-05-08 12:01:31 +08:00
parent e06fe34fe6
commit e7871cf2bf

View File

@ -74,10 +74,14 @@ async function* chatReplayStream(
const urlParams = new URLSearchParams(window.location.search);
let replayFilePath = "";
if (urlParams.has("mock")) {
if (urlParams.get("mock")) {
replayFilePath = `/mock/${urlParams.get("mock")!}.txt`;
} else {
replayFilePath =
params.interrupt_feedback === "accepted"
? "/mock/before-interrupt.txt"
: "/mock/after-interrupt.txt";
}
} else {
const replayId = extractReplayIdFromSearchParams(window.location.search);
if (replayId) {