From bbbf82ff933e448624a23fdf323c61186c6ad064 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Wed, 11 Aug 2021 22:32:45 +0200 Subject: [PATCH] Fix bug for ordering checkboxes --- editor/src/actions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/editor/src/actions.js b/editor/src/actions.js index d021144..9cca700 100644 --- a/editor/src/actions.js +++ b/editor/src/actions.js @@ -56,10 +56,10 @@ function sort(id, property, direction) { let children = this.getChildren(id) if (property === 'todo') { children = _.orderBy(children, item => { - let res = item.text.match(/^#\[\[(TODO|DONE)/) + const res = item.text.match(/^#\[\[(TODO|DONE)/) if (!res) return "C"; - if (res[1] === 'TODO') return direction === 'asc' ? "A" : "B"; - if (res[1] === 'DONE') return direction === 'asc' ? "B" : "A"; + if (res[1] === 'TODO') return "A"; + if (res[1] === 'DONE') return "B"; return "D"; }, direction) } else {