Skip to content

Commit

Permalink
Merge pull request #4103 from FlowFuse/fix-application-home-view
Browse files Browse the repository at this point in the history
Fix race condition in loading application status
  • Loading branch information
cstns authored Jul 4, 2024
2 parents c462ac1 + 52f2ed6 commit e86adb9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="instance-tile">
<div class="status">
<InstanceStatusBadge
:status="localInstance.meta.state"
:status="localInstance.meta?.state"
text=""
:pendingStateChange="localInstance.pendingStateChange"
:optimisticStateChange="localInstance.optimisticStateChange"
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/pages/team/Applications/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ export default {
const applicationsPromise = teamApi.getTeamApplications(this.team.id, { associationsLimit: ASSOCIATIONS_LIMIT })
// Not waited for as it can resolve in any order
this.updateApplicationAssociationStatuses()
const applications = (await applicationsPromise).applications
applications.forEach((applicationData) => {
const application = applicationsMap.get(applicationData.id) || {}
Expand Down Expand Up @@ -179,6 +176,8 @@ export default {
})
})
this.applications = applicationsMap
// Only update statuses *after* populating this.applications
this.updateApplicationAssociationStatuses()
}
this.loading = false
},
Expand Down

0 comments on commit e86adb9

Please sign in to comment.