fix length issue

This commit is contained in:
Karol Wypchlo 2021-02-08 17:00:16 +01:00
parent f968e6a6c8
commit 6161c8fa2f
2 changed files with 4 additions and 4 deletions

View File

@ -123,7 +123,7 @@ export default function Login({ flow }) {
/>
</div>
{field.errors && field.errors.length > 0 && (
{Boolean(field.errors?.length) && (
<div className="mt-2">
<Message items={field.errors.map(({ message }) => message)} />
</div>
@ -144,7 +144,7 @@ export default function Login({ flow }) {
Sign in
</button>
{flow.methods.password.config.errors.length > 0 && (
{Boolean(flow.methods.password.config.errors?.length) && (
<Message items={flow.methods.password.config.errors.map(({ message }) => message)} />
)}
</form>

View File

@ -133,7 +133,7 @@ export default function Registration({ flow }) {
value={formik.values[field.name]}
className="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-green-500 focus:border-green-500 sm:text-sm"
/>
{field.errors && field.errors.length > 0 && (
{Boolean(field.errors?.length) && (
<div className="mt-2">
<Message items={field.errors.map(({ message }) => message)} />
</div>
@ -149,7 +149,7 @@ export default function Registration({ flow }) {
Sign up
</button>
{flow.methods.password.config.errors.length > 0 && (
{Boolean(flow.methods.password.config.errors?.length) && (
<Message items={flow.methods.password.config.errors.map(({ message }) => message)} />
)}
</form>