mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Prevented modal close and showed correct due class in modal
This commit is contained in:
@@ -42,10 +42,12 @@ habitrpg.controller('NotificationCtrl',
|
|||||||
showCompleted: false,
|
showCompleted: false,
|
||||||
type: 'daily',
|
type: 'daily',
|
||||||
};
|
};
|
||||||
|
modalScope.processingYesterdailies = true;
|
||||||
|
|
||||||
$scope.yesterDailiesModalOpen = true;
|
$scope.yesterDailiesModalOpen = true;
|
||||||
$rootScope.openModal('yesterDailies', {
|
$rootScope.openModal('yesterDailies', {
|
||||||
scope: modalScope,
|
scope: modalScope,
|
||||||
|
backdrop: 'static',
|
||||||
controller: ['$scope', 'Tasks', 'User', '$rootScope', function ($scope, Tasks, User, $rootScope) {
|
controller: ['$scope', 'Tasks', 'User', '$rootScope', function ($scope, Tasks, User, $rootScope) {
|
||||||
$rootScope.$on('task:scored', function (event, data) {
|
$rootScope.$on('task:scored', function (event, data) {
|
||||||
var task = data.task;
|
var task = data.task;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
scope: true,
|
scope: true,
|
||||||
link: function($scope, element, attrs) {
|
link: function($scope, element, attrs) {
|
||||||
$scope.getClasses = function (task, user, list, main) {
|
$scope.getClasses = function (task, user, list, main) {
|
||||||
return Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main);
|
return Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main, $scope.processingYesterdailies);
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.showNoteDetails = function (task) {
|
$scope.showNoteDetails = function (task) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
shouldDo,
|
shouldDo,
|
||||||
} from '../cron';
|
} from '../cron';
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Task classes given everything about the class
|
Task classes given everything about the class
|
||||||
@@ -8,7 +9,7 @@ Task classes given everything about the class
|
|||||||
|
|
||||||
// TODO move to the client
|
// TODO move to the client
|
||||||
|
|
||||||
module.exports = function taskClasses (task, filters = [], dayStart = 0, lastCron = Number(new Date()), showCompleted = false, main = false) {
|
module.exports = function taskClasses (task, filters = [], dayStart = 0, lastCron = Number(new Date()), showCompleted = false, main = false, processingYesterdailies = false) {
|
||||||
if (!task) {
|
if (!task) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@@ -34,7 +35,9 @@ module.exports = function taskClasses (task, filters = [], dayStart = 0, lastCro
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'todo' || type === 'daily') {
|
if (type === 'todo' || type === 'daily') {
|
||||||
let notDue = !shouldDo(Number(new Date()), task, { dayStart });
|
let dayShouldDo = moment();
|
||||||
|
if (processingYesterdailies) dayShouldDo.subtract(1, 'days');
|
||||||
|
let notDue = !shouldDo(Number(dayShouldDo), task, { dayStart });
|
||||||
let isNotDueDaily = type === 'daily' && notDue;
|
let isNotDueDaily = type === 'daily' && notDue;
|
||||||
|
|
||||||
if (completed || isNotDueDaily) {
|
if (completed || isNotDueDaily) {
|
||||||
|
|||||||
Reference in New Issue
Block a user