Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/web/pages/alerts/AlertComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ const AlertComponent = ({
useState(false);
const [credentialDialogTitle, setCredentialDialogTitle] = useState('');
const [credentialTypes, setCredentialTypes] = useState([]);
const [credentialError, setCredentialError] = useState();

const [id, setId] = useState(undefined);
const [alert, setAlert] = useState(undefined);
Expand Down Expand Up @@ -285,7 +284,7 @@ const AlertComponent = ({

const handleCreateCredential = credentialData => {
let credentialId;
gmp.credential
return gmp.credential
.create(credentialData)
.then(response => {
credentialId = response.data.id;
Expand All @@ -310,9 +309,6 @@ const AlertComponent = ({
} else if (String(credentialTypeRef.current) === 'pw') {
setMethodDataPkcs12Credential(credentialId);
}
})
.catch(error => {
setCredentialError(error.message);
});
};

Expand Down Expand Up @@ -1175,11 +1171,9 @@ const AlertComponent = ({
)}
{credentialDialogVisible && (
<CredentialDialog
error={credentialError}
title={credentialDialogTitle}
types={credentialTypes}
onClose={handleCloseCredentialDialog}
onErrorClose={() => setCredentialError(undefined)}
onSave={handleCreateCredential}
/>
)}
Expand Down
Loading