Skip to content

Commit

Permalink
Adapt loading checks to changed relation in API
Browse files Browse the repository at this point in the history
  • Loading branch information
carlobeltrame committed Feb 8, 2022
1 parent 7ddfdb0 commit 17daa28
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions frontend/src/components/camp/CampPrint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ export default {
return scheduleEntry._meta.loading ||
scheduleEntry.activity()._meta.loading ||
scheduleEntry.activity().category()._meta.loading ||
scheduleEntry.activity().campCollaborations()._meta.loading ||
scheduleEntry.activity().campCollaborations().items.some(responsible => {
scheduleEntry.activity().activityResponsibles()._meta.loading ||
scheduleEntry.activity().activityResponsibles().items.some(responsible => {
return responsible._meta.loading ||
(responsible.user() !== null && responsible.user()._meta.loading)
responsible.campCollaboration()._meta.loading ||
(responsible.campCollaboration().user() !== null && responsible.campCollaboration().user()._meta.loading)
}) ||
scheduleEntry.activity().contentNodes()._meta.loading ||
scheduleEntry.activity().contentNodes().items.some(contentNode => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/print/picasso/Responsibles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const initialsStyles = {
}

function Responsibles ({ activity, styles }) {
const last = activity.campCollaborations().items.length - 1
const last = activity.activityResponsibles().items.length - 1
return <View style={{ ...avatarsStyles, ...styles }}>
{activity.activityResponsibles().items.map((activityResponsible, index) => {
return <View key={activityResponsible.campCollaboration().id} style={{
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/views/camp/CampProgram.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ export default {
return scheduleEntry._meta.loading ||
scheduleEntry.activity()._meta.loading ||
scheduleEntry.activity().category()._meta.loading ||
scheduleEntry.activity().campCollaborations()._meta.loading ||
scheduleEntry.activity().campCollaborations().items.some(responsible => {
scheduleEntry.activity().activityResponsibles()._meta.loading ||
scheduleEntry.activity().activityResponsibles().items.some(responsible => {
return responsible._meta.loading ||
(responsible.user() !== null && responsible.user()._meta.loading)
responsible.campCollaboration()._meta.loading ||
(responsible.campCollaboration().user() !== null && responsible.campCollaboration().user()._meta.loading)
})
})
})
Expand Down

0 comments on commit 17daa28

Please sign in to comment.