fix: checklist update not working

Resolves #1114
This commit is contained in:
kolaente 2021-12-05 14:18:53 +01:00
parent 852d71e8b7
commit bba9a8e008
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 2 additions and 1 deletions

View file

@ -21,6 +21,7 @@ Here's some text in between
expect(checkboxes[0]).toBe(0) expect(checkboxes[0]).toBe(0)
expect(checkboxes[1]).toBe(18) expect(checkboxes[1]).toBe(18)
expect(checkboxes[2]).toBe(69) expect(checkboxes[2]).toBe(69)
expect(checkboxes[3]).toBe(90)
}) })
it('should find one checkbox with *', () => { it('should find one checkbox with *', () => {
const text: string = '* [ ] Lorem Ipsum' const text: string = '* [ ] Lorem Ipsum'

View file

@ -40,7 +40,7 @@ export const findCheckboxesInText = (text: string): number[] => {
return [ return [
...checkboxes.checked, ...checkboxes.checked,
...checkboxes.unchecked, ...checkboxes.unchecked,
].sort() ].sort((a, b) => a < b ? -1 : 1)
} }
export const getChecklistStatistics = (text: string): CheckboxStatistics => { export const getChecklistStatistics = (text: string): CheckboxStatistics => {