Skip to content

Commit 2b26eb2

Browse files
Habit and Daily task counts not displaying for certain filters (#15595)
* habits-all fixed * dailies section fixed * to do counter fixed * Remove linting changes and apply logic fix with single quotes * refactor(tasks): simpler badgeCount logic * fix(lint): remove unused import --------- Co-authored-by: Kalista Payne <kalista@habitica.com>
1 parent 8e042ca commit 2b26eb2

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

website/client/src/components/tasks/column.vue

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@
348348
import throttle from 'lodash/throttle';
349349
import isEmpty from 'lodash/isEmpty';
350350
import draggable from 'vuedraggable';
351-
import { shouldDo } from '@/../../common/script/cron';
352351
import inAppRewards from '@/../../common/script/libs/inAppRewards';
353352
import taskDefaults from '@/../../common/script/libs/taskDefaults';
354353
import Task from './task';
@@ -482,25 +481,10 @@ export default {
482481
return this.$t('addATask', { type });
483482
},
484483
badgeCount () {
485-
// 0 means the badge will not be shown
486-
// It is shown for the all and due views of dailies
487-
// and for the active and scheduled views of todos.
488-
if (this.type === 'todo' && this.activeFilter.label !== 'complete2') {
489-
return this.taskList.length;
490-
} if (this.type === 'daily') {
491-
if (this.activeFilter.label === 'due') {
492-
return this.taskList.length;
493-
} if (this.activeFilter.label === 'all') {
494-
return this.taskList
495-
.reduce(
496-
(count, t) => (!t.completed
497-
&& shouldDo(new Date(), t, this.getUserPreferences) ? count + 1 : count),
498-
0,
499-
);
500-
}
484+
if (this.type === 'reward') {
485+
return 0;
501486
}
502-
503-
return 0;
487+
return this.taskList.length;
504488
},
505489
},
506490
watch: {

0 commit comments

Comments
 (0)