Skip to content

Commit

Permalink
Fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHalbesleben committed Sep 17, 2022
1 parent b3dab0e commit 499c975
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/store/index.vuex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@ export class Store extends VuexModule {
}

// For each task, with tasks due earlier scheduled first
let i = 0;
for (const task of this.tasks) {
i++;
let { chunks } = task;
chunks -= task.lockedChunks.length;
chunks -= this.completedChunks.filter(
Expand All @@ -150,8 +148,8 @@ export class Store extends VuexModule {

for (let i = 0; i <= daysUntilDue; i++) {
combinedDayData[i] =
getTotalTime(chunksByDay[i]) +
getTotalEffort(chunksByDay[i]) * this.settings.effortWeight +
getTotalTime(i) +
getTotalEffort(i) * this.settings.effortWeight +
completedTimes[i] +
completedEfforts[i] * this.settings.effortWeight +
(this.settings.timeIncludesEvents ? eventTimes[i] : 0);
Expand All @@ -162,7 +160,7 @@ export class Store extends VuexModule {
// Assign to the latest possible day (if none work, will be due date) by default
for (let d = 0; d <= daysUntilDue; d++) {
const dayHasTime =
getTotalTime(chunksByDay[d]) + chunkDuration <=
getTotalTime(d) + chunkDuration <=
this.settings.timeOnDay(
DateUtils.applyDayOffset(d, DateUtils.currentDate)
) -
Expand All @@ -185,7 +183,7 @@ export class Store extends VuexModule {
// Finds the day with that has the lowest effort compared to the next and sets that as the chunk's due date
for (let d = loopStart; loopEnded(d); d += loopIncrement) {
const dayHasTime =
getTotalTime(chunksByDay[d]) + chunkDuration <=
getTotalTime(d) + chunkDuration <=
this.settings.timeOnDay(
DateUtils.applyDayOffset(d, DateUtils.currentDate)
) -
Expand Down

0 comments on commit 499c975

Please sign in to comment.