Skip to content
Snippets Groups Projects
Unverified Commit 1845ec84 authored by shall0pass's avatar shall0pass Committed by GitHub
Browse files

Use setZero function within goal templates for speed improvement (#1344)

parent 9bccacea
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ import { amountToInteger, integerToAmount } from '../../shared/util'; ...@@ -7,7 +7,7 @@ import { amountToInteger, integerToAmount } from '../../shared/util';
import * as db from '../db'; import * as db from '../db';
import { getRuleForSchedule, getNextDate } from '../schedules/app'; import { getRuleForSchedule, getNextDate } from '../schedules/app';
import { setBudget, getSheetValue } from './actions'; import { setBudget, setZero, getSheetValue } from './actions';
import { parse } from './goal-template.pegjs'; import { parse } from './goal-template.pegjs';
export function applyTemplate({ month }) { export function applyTemplate({ month }) {
...@@ -63,13 +63,9 @@ async function processTemplate(month, force) { ...@@ -63,13 +63,9 @@ async function processTemplate(month, force) {
? template[l].priority ? template[l].priority
: lowestPriority; : lowestPriority;
} }
await setBudget({
category: category.id,
month,
amount: 0,
});
} }
} }
setZero({ month });
// find all remainder templates, place them after all other templates // find all remainder templates, place them after all other templates
let remainder_found; let remainder_found;
let remainder_priority = lowestPriority + 1; let remainder_priority = lowestPriority + 1;
......
---
category: Enhancements
authors: [shall0pass]
---
Goals: Use setZero function within goal templates for speed improvement
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment