From 8e7ca37c33157b3f778b44a66b14cce870f22240 Mon Sep 17 00:00:00 2001 From: danielc-n Date: Thu, 11 Apr 2024 16:39:30 +0200 Subject: [PATCH] added a better user-friendly messages to nugde the user to import at least one resource for a Juxtalinear project --- renderer/src/components/Projects/NewProject.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/renderer/src/components/Projects/NewProject.js b/renderer/src/components/Projects/NewProject.js index cda440ab..28f0330a 100644 --- a/renderer/src/components/Projects/NewProject.js +++ b/renderer/src/components/Projects/NewProject.js @@ -111,6 +111,7 @@ export default function NewProject({ call, project, closeEdit }) { setLanguage, createProject, setNewProjectFields, + setImportedBookCodes, }, } = React.useContext(ProjectContext); const { t } = useTranslation(); @@ -218,6 +219,7 @@ export default function NewProject({ call, project, closeEdit }) { setSnackText(status[0].value); setOpenSnackBar(true); if (status[0].type === 'success') { + setImportedBookCodes([]); if (call === 'edit') { closeEdit(); } else { @@ -469,6 +471,8 @@ export default function NewProject({ call, project, closeEdit }) { > {t('btn-import-books')} + {headerDropDown === 'Juxta' && ( *)} + {headerDropDown === 'Juxta' && (!importedBookCodes || importedBookCodes.length === 0) && (  You must provide at least one book resource)} @@ -537,9 +541,14 @@ export default function NewProject({ call, project, closeEdit }) { /> {}} showCancelButton={false}