added new loader in export app modal when changing versions (#9941)

* added new loader in export app modal when changing versions

* removed comments
This commit is contained in:
Rudhra Deep Biswas 2024-06-18 13:48:00 +05:30 committed by GitHub
parent 0635fc95dd
commit 881f6003f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,6 +12,7 @@ export default function ExportAppModal({ title, show, closeModal, customClassNam
const [versionId, setVersionId] = useState(undefined);
const [exportTjDb, setExportTjDb] = useState(true);
const [currentVersion, setCurrentVersion] = useState(undefined);
const [versionSelectLoading, setVersionSelectLoading] = useState(false);
const [loading, setLoading] = useState(false);
useEffect(() => {
@ -39,7 +40,7 @@ export default function ExportAppModal({ title, show, closeModal, customClassNam
useEffect(() => {
async function fetchAppTables() {
setLoading(true);
setVersionSelectLoading(true);
try {
if (!versionId) return;
const fetchTables = await appsService.getTables(app.id); // this is used to get all tables
@ -75,7 +76,7 @@ export default function ExportAppModal({ title, show, closeModal, customClassNam
});
closeModal();
}
setLoading(false);
setVersionSelectLoading(false);
}
fetchAppTables();
// eslint-disable-next-line react-hooks/exhaustive-deps
@ -209,7 +210,7 @@ export default function ExportAppModal({ title, show, closeModal, customClassNam
Export All
</ButtonSolid>
<ButtonSolid
className="import-export-footer-btns"
className={`import-export-footer-btns ${versionSelectLoading ? 'btn-loading' : ''}`}
data-cy="export-selected-version-button"
onClick={() => exportApp(app, versionId, exportTjDb, tables)}
>