Skip to content

Commit

Permalink
feat: prevent unnecessary call to comments in task & us
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfran committed Feb 19, 2024
1 parent 2847ada commit 207f1ff
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/modules/history/history.controller.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ class HistorySectionController
return @activityService.loading

_loadHistory: () ->
@._loadComments()
if @.totalComments == 0
@.commentsNum = 0
return
else
@._loadComments()

@._loadActivity()

_loadActivity: () ->
Expand Down
1 change: 1 addition & 0 deletions app/modules/history/history.directive.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ HistorySectionDirective = () ->
name: "@",
id: "=",
project: "="
totalComments: "="
}
}

Expand Down
1 change: 1 addition & 0 deletions app/partials/task/task-detail.jade
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ div.wrapper(
type="task"
name="task"
id="task.id"
total-comments="task.total_comments"
project="project"
)

Expand Down
1 change: 1 addition & 0 deletions app/partials/us/us-detail.jade
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ div.wrapper(
name="us"
id="us.id"
project="project"
total-comments="us.total_comments"
)

sidebar.sidebar.ticket-data
Expand Down

0 comments on commit 207f1ff

Please sign in to comment.