-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Desktop: Fixes #10668: Tags and Delete note not being available on Search and on All Notes list #10729
Conversation
I changed how the My solution was to separate the logic of That means that I had to update all enabled conditions that used Of course, for the Permanenly delete note the logic is different, we are checking if the note is not read-only AND is on Trash. |
|
@@ -68,7 +70,7 @@ export default function stateToWhenClauseContext(state: State, options: WhenClau | |||
|
|||
// Current location | |||
inConflictFolder: state.selectedFolderId === Folder.conflictFolderId(), | |||
inTrash: state.selectedFolderId === getTrashFolderId() || commandFolder && !!commandFolder.deleted_time, | |||
inTrash: (state.selectedFolderId === getTrashFolderId() || commandFolder && !!commandFolder.deleted_time) && hasDeletedTime, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's already a check on deleted_time
here. Couldn't you just add a check on the selected note?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right, I just kept the check for the selectedNote
object in this case and included it in the original inTrash boolean logic.
|
@laurent22 I added basic tests like suggested before |
expect(result.inTrash).toBe(false); | ||
}); | ||
|
||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use plain English for the titles. Don't use variable names or at least try to avoid this - this is meant to be a high level description of the test. It should show your intention which hopefully can be expressed in English. For example "deleted_time" is "0" means note is deleted, "selectedFolderId is not trash" means the selected folder is not the trash, etc.
Looks good now, thanks Pedro! |
Fixes #10668
Description
The issue existed because the state
selectedFolderId
doesn't change when we select All Notes or do a Search. Since we use theselectedFolderId
to check if it is identical to the static trash id to identify if we are in the "Trash context", switching from Trash to all notes was like we were still in the same context.Testing
Test case 1
Test case 2