feat: added reset experiment (in UI)

ref:N25B-400
This commit is contained in:
Pim Hutting
2026-01-16 14:25:26 +01:00
parent c4e3ab27b2
commit d8cae9f838
3 changed files with 40 additions and 18 deletions

View File

@@ -44,21 +44,17 @@ export async function resetPhase(): Promise<void> {
}
/**
* Sends an API call to the CB for going to reset the experiment
* In case we can't go to the next phase, the function will throw an error.
*/
export async function resetExperiment(): Promise<void> {
const type = "reset_experiment"
const context = ""
sendAPICall(type, context)
}
* Sends an API call to the CB for going to pause experiment
*/
export async function pauseExperiment(): Promise<void> {
const type = "pause"
const context = "true"
sendAPICall(type, context)
}
/**
* Sends an API call to the CB for going to resume experiment
*/
export async function playExperiment(): Promise<void> {
const type = "pause"
const context = "false"
@@ -111,6 +107,7 @@ export function useExperimentLogger(onUpdate?: (data: ExperimentStreamData) => v
};
}, []);
}
/**
* A hook that listens to the status stream that updates active conditional norms
* via updates sent from the backend
@@ -131,5 +128,5 @@ export function useStatusLogger(onUpdate?: (data: any) => void) {
} catch (err) { console.warn("Status stream error:", err); }
};
return () => eventSource.close();
}, []); // LEGE dependency array
}, []);
}