diff --git a/src/pages/DataPage.svelte b/src/pages/DataPage.svelte index 2ec47c5f9..8ea50430e 100644 --- a/src/pages/DataPage.svelte +++ b/src/pages/DataPage.svelte @@ -123,6 +123,6 @@ - + {/if} diff --git a/src/pages/training/TrainingButton.svelte b/src/pages/training/TrainingButton.svelte index 02c2de14f..534633a97 100644 --- a/src/pages/training/TrainingButton.svelte +++ b/src/pages/training/TrainingButton.svelte @@ -9,10 +9,11 @@ import StandardButton from '../../components/StandardButton.svelte'; import { trainModel } from '../../script/ml'; import { t } from '../../i18n'; - import StandardDialog from '../../components/dialogs/StandardDialog.svelte'; import { Paths, navigate } from '../../router/paths'; import { gestures } from '../../script/stores/Stores'; + export let type: 'navigate' | 'train' = 'train'; + $: trainButtonLabel = !$state.isPredicting ? 'menu.trainer.trainModelButton' : 'menu.trainer.trainNewModelButton'; @@ -28,36 +29,19 @@ trainingDialogOpen = false; }; - const startTraining = async (): Promise => { + const startTraining = () => { closeTrainingDialog(); + trainModel(); + }; + + const navitgateToTrainingPage = () => { navigate(Paths.TRAINING); - const shouldRedirect = await trainModel(); - if (shouldRedirect) { - navigate(Paths.MODEL); - } }; { - trainingDialogOpen = true; - }} + onClick={type === 'navigate' ? navitgateToTrainingPage : startTraining} disabled={trainingButtonDisabled} type="primary" >{$t(trainButtonLabel)} - - -
-

{$t('content.data.trainDialog.title')}

-

{$t('content.data.trainDialog.text')}

-
- {$t('connectMB.backButton')} - {$t('content.data.trainDialog.title')} -
-
-