Skip to content

Commit

Permalink
wait for user model to load before creating school dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelchadwick committed Oct 4, 2024
1 parent d85bfa5 commit 94d84c1
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/frontend/app/components/new-user.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,18 @@
<label for="primary-school-{{templateId}}">
{{t "general.primarySchool"}}:
</label>
<select
id="primary-school-{{templateId}}"
{{on "change" (pick "target.value" (set this "schoolId"))}}
>
{{#each (sort-by "title" this.schools) as |school|}}
<option value={{school.id}} selected={{eq school this.bestSelectedSchool}}>
{{school.title}}
</option>
{{/each}}
</select>
{{#if this.userModel.isResolved}}
<select
id="primary-school-{{templateId}}"
{{on "change" (pick "target.value" (set this "schoolId"))}}
>
{{#each (sort-by "title" this.schools) as |school|}}
<option value={{school.id}} selected={{eq school this.bestSelectedSchool}}>
{{school.title}}
</option>
{{/each}}
</select>
{{/if}}
</div>
{{#unless this.nonStudentMode}}
<div class="item last" data-test-cohort>
Expand Down

0 comments on commit 94d84c1

Please sign in to comment.