1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-03-21 12:29:03 +01:00

set payzen public key as invalid if the field is empty

This commit is contained in:
Sylvain 2021-05-19 09:34:31 +02:00
parent c6bc9f1c15
commit dd1d05cc3a

View File

@ -74,9 +74,7 @@ const PayZenKeysFormComponent: React.FC<PayZenKeysFormProps> = ({ onValidKeys, o
* Depending on the test result, assign an add-on icon plus a style to notify the user.
*/
const testPublicKey = (key: string) => {
if (!key) return;
if (!key.match(/^[0-9]+:/)) {
if (!key || !key.match(/^[0-9]+:/)) {
setPublicKeyAddOn(<i className="fa fa-times" />);
setPublicKeyAddOnClassName('key-invalid');
return;