1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

handle no key in payzen keys form

This commit is contained in:
Sylvain 2021-05-18 13:50:27 +02:00
parent 4826db7cf0
commit 6b99b00d5e

View File

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