From 95df3522a15631abc51a4295cae0ea401a8d4e1e Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Tue, 14 Sep 2021 19:58:52 +0200 Subject: feat: add eslint-plugin-unicorn (#1936) --- src/components/auth/Invite.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/components/auth') diff --git a/src/components/auth/Invite.js b/src/components/auth/Invite.js index 519691ede..df8980314 100644 --- a/src/components/auth/Invite.js +++ b/src/components/auth/Invite.js @@ -65,7 +65,7 @@ class Invite extends Component { { fields: { invite: [ - ...Array(3).fill({ + ...Array.from({ length: 3 }).fill({ fields: { name: { label: this.props.intl.formatMessage(messages.nameLabel), @@ -95,19 +95,19 @@ class Invite extends Component { this.props.intl, ); - document.querySelector('input:first-child').focus(); + document.querySelector('input:first-child')?.focus(); } submit(e) { e.preventDefault(); - this.form.submit({ + this.form?.submit({ onSuccess: form => { this.props.onSubmit({ invites: form.values().invite }); - this.form.clear(); + this.form?.clear(); // this.form.$('invite.0.name').focus(); // path accepted but does not focus ;( - document.querySelector('input:first-child').focus(); + document.querySelector('input:first-child')?.focus(); this.setState({ showSuccessInfo: true }); }, onError: () => {}, -- cgit v1.2.3-70-g09d2