Skip to content

Commit 9d8e5e1

Browse files
Redirect to test page after training (#378)
This functionality was only implemented via a training dialog that can be dimissed.
1 parent 28767e2 commit 9d8e5e1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/pages/DataSamplesPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const DataSamplesPage = () => {
7575
<Button
7676
ref={trainButtonRef}
7777
className={tourElClassname.trainModelButton}
78-
onClick={trainModelFlowStart}
78+
onClick={() => trainModelFlowStart(handleNavigateToModel)}
7979
variant={hasSufficientData ? "primary" : "secondary-disabled"}
8080
>
8181
<FormattedMessage id={"menu.trainer.trainModelButton"} />

src/store.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export interface Actions {
135135
recordingStarted(): void;
136136
recordingStopped(): void;
137137
newSession(): void;
138-
trainModelFlowStart: () => Promise<void>;
138+
trainModelFlowStart: (callback?: () => void) => Promise<void>;
139139
closeTrainModelDialogs: () => void;
140140
trainModel(): Promise<boolean>;
141141
setSettings(update: Partial<Settings>): void;
@@ -415,7 +415,7 @@ export const useStore = create<Store>()(
415415
});
416416
},
417417

418-
async trainModelFlowStart() {
418+
async trainModelFlowStart(callback?: () => void) {
419419
const {
420420
settings: { showPreTrainHelp },
421421
gestures,
@@ -431,6 +431,7 @@ export const useStore = create<Store>()(
431431
});
432432
} else {
433433
await trainModel();
434+
callback?.();
434435
}
435436
},
436437

0 commit comments

Comments
 (0)