Skip to content

Commit

Permalink
fix: 🐛 fix bug in getTaskPath - address case where inbox contains nes…
Browse files Browse the repository at this point in the history
…ted tasks
  • Loading branch information
ksalzke committed Aug 22, 2023
1 parent 4b82044 commit b7c95e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions fuzzySearchLib.omnifocusjs/Resources/fuzzySearchLib.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
lib.getTaskPath = function (task) {
var getPath = function (task) {
if (!task.parent)
return task.name; // project in inbox
if (task.parent === task.containingProject.task)
return task.name; // project in inbox, first level
if (task.containingProject && task.parent === task.containingProject.task)
return task.containingProject.name + " > " + task.name;
else if (task.parent === task.containingProject.task)
else if (task.containingProject && task.parent === task.containingProject.task)
return task.name;
else
return getPath(task.parent) + " > " + task.name;
Expand Down
6 changes: 3 additions & 3 deletions src/fuzzySearchLib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ interface FuzzySearchForm extends Form {

lib.getTaskPath = (task: Task) => {
const getPath = (task) => {
if (!task.parent) return task.name // project in inbox
if (task.parent === task.containingProject.task) return `${task.containingProject.name} > ${task.name}`
else if (task.parent === task.containingProject.task) return task.name
if (!task.parent) return task.name // project in inbox, first level
if (task.containingProject && task.parent === task.containingProject.task) return `${task.containingProject.name} > ${task.name}`
else if (task.containingProject && task.parent === task.containingProject.task) return task.name
else return `${getPath(task.parent)} > ${task.name}`
}
return getPath(task)
Expand Down

0 comments on commit b7c95e2

Please sign in to comment.