fix: reset state and fetch arr instances when ImportModal opens

This commit is contained in:
Sam Chau
2025-01-09 17:10:14 +10:30
parent c15502fa97
commit 9f6aec5d53

View File

@@ -11,8 +11,11 @@ const ImportModal = ({isOpen, onClose, onImport, type}) => {
const [isImporting, setIsImporting] = useState(false);
useEffect(() => {
// Fetch available arrs when modal opens
// Reset state when modal opens and fetch arr instances
if (isOpen) {
setSelectedArr('');
setError('');
setIsImporting(false);
fetchArrs();
}
}, [isOpen]);