Merge pull request #10985 from tchak/fix-email-checker
fix(email-checker): success can have no suggestions
This commit is contained in:
commit
ee3ee8f78c
1 changed files with 2 additions and 2 deletions
|
@ -4,7 +4,7 @@ import { ApplicationController } from './application_controller';
|
|||
type CheckEmailResponse =
|
||||
| {
|
||||
success: true;
|
||||
suggestions: string[];
|
||||
suggestions?: string[];
|
||||
}
|
||||
| { success: false };
|
||||
|
||||
|
@ -38,7 +38,7 @@ export class EmailInputController extends ApplicationController {
|
|||
.catch(() => null);
|
||||
|
||||
if (data?.success) {
|
||||
const suggestion = data.suggestions.at(0);
|
||||
const suggestion = data.suggestions?.at(0);
|
||||
if (suggestion) {
|
||||
this.suggestionTarget.innerHTML = suggestion;
|
||||
show(this.ariaRegionTarget);
|
||||
|
|
Loading…
Reference in a new issue