Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

Commit

Permalink
Update variable;
Browse files Browse the repository at this point in the history
Fix text by trimming the event.target.value at the start of the function.
Remove if statement because we still want the currentRecipentValue & recipientAddressChanged to take the eventVal, even if it's no value
  • Loading branch information
tboeckmann committed Feb 4, 2021
1 parent 9529b30 commit e802c27
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/app/inbox/inbox-compose/inbox-compose.component.ts
Expand Up @@ -39,7 +39,7 @@ export class InboxComposeComponent implements OnInit {
private subscription
public currentRecipientValue

private recipientAddressChanged = new Subject<string>();
public recipientAddressChanged = new Subject<string>();
public recipientLoadingIcon = ""
public recipientLoadingText = ""
public messageToField = ""
Expand Down Expand Up @@ -136,19 +136,19 @@ export class InboxComposeComponent implements OnInit {
* @param event the event from keyup
*/
public recipientResolve(event) {
if (event.target.value == "") {
let eventVal = event.target.value.trim();
if (eventVal == "") {
this.setRecipientLoadingIcon("clear")
this.setRecipientLoadingText()
this.resetModelToField()
} else if (this.currentRecipientValue != event.target.value) {
} else if (this.currentRecipientValue != eventVal) {
this.setRecipientLoadingIcon("loading")
this.setRecipientLoadingText()
this.resetModelToField()
}
if (event.target.value && event.target.value.length > 0) {
this.currentRecipientValue = event.target.value.trim();
this.recipientAddressChanged.next(event.target.value);
}
this.currentRecipientValue = eventVal
this.recipientAddressChanged.next(eventVal);

}

/**
Expand Down

0 comments on commit e802c27

Please sign in to comment.