diff --git a/pmp-reactjs-ui/src/pages/PartnerCertificatesList.js b/pmp-reactjs-ui/src/pages/PartnerCertificatesList.js index 206fe8253..4c4b09e5c 100644 --- a/pmp-reactjs-ui/src/pages/PartnerCertificatesList.js +++ b/pmp-reactjs-ui/src/pages/PartnerCertificatesList.js @@ -19,9 +19,11 @@ function PartnerCertificatesList() { setSelectedPartnerData(partner); }; - const closePopup = () => { + const closePopup = (reload) => { setShowPopup(false); - window.location.reload(); + if (reload) { + window.location.reload(); + } }; const moveToHome = () => { diff --git a/pmp-reactjs-ui/src/pages/UploadCertificate.js b/pmp-reactjs-ui/src/pages/UploadCertificate.js index 94f0e2bfb..9ab2a6fe8 100644 --- a/pmp-reactjs-ui/src/pages/UploadCertificate.js +++ b/pmp-reactjs-ui/src/pages/UploadCertificate.js @@ -10,18 +10,17 @@ function UploadCertificate({ closePopup, partnerData }) { const [errorMsg, setErrorMsg] = useState(""); const [certificateData, setCertificateData] = useState(""); const [formattedDate, setFormattedDate] = useState(""); - const [rotation, setRotation] = useState(0); const [dataLoaded, setDataLoaded] = useState(true); const openDropdown = () => { setIsDropdownOpen(!isDropdownOpen); }; const clickOnCancel = () => { - closePopup(); + closePopup(false); }; const clickOnSubmit = async () => { if (uploadSuccess) { - closePopup(); + closePopup(true); } else { setDataLoaded(false); let request = { @@ -79,19 +78,6 @@ function UploadCertificate({ closePopup, partnerData }) { setUploadSuccess(false); }; - useEffect(() => { - let intervalId; - if (uploading) { - intervalId = setInterval(() => { - setRotation(rotation => (rotation + 1) % 360); - }, 5); - } else { - clearInterval(intervalId); - setRotation(0); - } - return () => clearInterval(intervalId); - }, [uploading]); - const handleFileChange = (event) => { const file = event.target.files[0]; if (file) { @@ -177,11 +163,11 @@ function UploadCertificate({ closePopup, partnerData }) { {isDropdownOpen && (
- selectDomainType("DEVICE")}>DEVICE + selectDomainType("DEVICE")}>DEVICE
- selectDomainType("FTM")}>FTM + selectDomainType("FTM")}>FTM
- selectDomainType("AUTH")}>AUTH + selectDomainType("AUTH")}>AUTH
)} @@ -191,26 +177,9 @@ function UploadCertificate({ closePopup, partnerData }) {
{uploading && (
- - - +
Selecting the file...