diff --git a/argilla-frontend/pages/dataset/_id/settings.vue b/argilla-frontend/pages/dataset/_id/settings.vue index 73752b46d9..e21ff0d0fd 100644 --- a/argilla-frontend/pages/dataset/_id/settings.vue +++ b/argilla-frontend/pages/dataset/_id/settings.vue @@ -42,6 +42,9 @@ export default { components: { InternalPage, }, + beforeRouteLeave(to, from, next) { + this.goToOutside(next); + }, setup() { return useDatasetSettingViewModel(); }, diff --git a/argilla-frontend/pages/dataset/_id/useDatasetSettingViewModel.ts b/argilla-frontend/pages/dataset/_id/useDatasetSettingViewModel.ts index 5d945ce673..5b8821fddf 100644 --- a/argilla-frontend/pages/dataset/_id/useDatasetSettingViewModel.ts +++ b/argilla-frontend/pages/dataset/_id/useDatasetSettingViewModel.ts @@ -94,7 +94,7 @@ export const useDatasetSettingViewModel = () => { ]; }); - const onGoToDataset = () => { + const goToDataset = () => { if (routes.previousRouteMatchWith(datasetId)) return routes.goBack(); routes.goToFeedbackTaskAnnotationPage(datasetId); @@ -112,7 +112,7 @@ export const useDatasetSettingViewModel = () => { if (datasetSetting.isVectorsModified) return goToTab("vector"); }; - const goToDataset = () => { + const goToOutside = (next) => { if (datasetSetting.isModified) { return notification.notify({ message: t("changes_no_submit"), @@ -120,7 +120,7 @@ export const useDatasetSettingViewModel = () => { permanent: true, type: "warning", onClick() { - onGoToDataset(); + next(); }, onClose() { goToTabWithModification(); @@ -128,7 +128,7 @@ export const useDatasetSettingViewModel = () => { }); } - onGoToDataset(); + next(); }; onBeforeMount(() => { @@ -155,6 +155,7 @@ export const useDatasetSettingViewModel = () => { isAdminOrOwnerRole, datasetId, datasetSetting, + goToOutside, goToDataset, }; };