Skip to content

Conversation

tejas-hosamani
Copy link

@tejas-hosamani tejas-hosamani commented Jul 6, 2024

Fixes issue - #127

image

@Leonezz
Copy link
Owner

Leonezz commented Jul 8, 2024

Hi @tejas-hosamani thanks for the contribution, I did some blaming and find out the code for sorting is removed when I try to optimize the task parsing with async functions.

I will build and test with your code, it will be merged in the next release if it goes well!

@tejas-hosamani
Copy link
Author

Sounds good, thank you!

Copy link
Owner

@Leonezz Leonezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tejas-hosamani please read the comments and check if there are changes needed.

let taskList = adapter.getTaskList();

const sortOptionFn = (0, eval)(this.userOptionModel.get("sort") || "")
if (sortOptionFn) taskList = taskList.sort(sortOptionFn)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorting tasks here might not work cauze some fields of the task items might not get parsed yet.
you need to sort after all the meta infos are parsed.


const taskListPromise = this.parseTasks(taskList)
taskListPromise.then(tasks => {
tasks = this.filterTasks(tasks);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add your sorting code after this would be good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants