Skip to content

Commit

Permalink
update sendMessage to task
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tordoff committed Dec 9, 2024
1 parent 0627e1b commit 7639ea1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { task } from 'ember-concurrency';
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
Expand Down Expand Up @@ -255,7 +256,8 @@ export default class InstitutionalUsersList extends Component<InstitutionalUsers
this.messageText = (event.target as HTMLTextAreaElement).value;
}

@action
@task
@waitFor
async sendMessage() {
if (!this.selectedUserId || !this.messageText.trim()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
</dialog.heading>
<dialog.main>
<div >
<label for='message-text' local-class="message-label">
<label for='message-text' local-class='message-label'>
{{t 'institutions.dashboard.send_message_modal.opening_message_label'}}
</label>
<textarea
Expand All @@ -229,7 +229,7 @@
aria-label={{t 'institutions.dashboard.send_message_modal.send_aira_label'}}
@type='primary'
@disabled={{not this.messageText}}
{{on 'click' (queue this.sendMessage dialog.close)}}
{{on 'click' (queue (perform this.sendMessage) dialog.close)}}
>
{{t 'institutions.dashboard.send_message_modal.send'}}
</Button>
Expand Down

0 comments on commit 7639ea1

Please sign in to comment.