-
Notifications
You must be signed in to change notification settings - Fork 563
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
Refactors closeNote to Redux #1895
Conversation
088a8f7
to
6f07ebb
Compare
6f07ebb
to
d86ab66
Compare
closeNote, | ||
toggleEditMode, | ||
toggleNoteInfo, | ||
}; |
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.
😎
(settings.focusModeEnabled || !isSmallScreen) | ||
), | ||
}); | ||
} |
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.
Earmarking to test…
|
||
default: | ||
return state; | ||
} |
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.
For actions like deleteNoteForever
and restoreNote
and the like is this now handled automatically by some other code, that the note closes?
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.
Noted in testing: the note closes automatically due to the filtering middleware which implicitly unselects it as it no longer exists.
} | ||
|
||
return state; | ||
}; |
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.
Thanks for removing this. Probably would have been nice to do it in a separate PR with its own traceable history, or at least a mention in the git
commit, since now we don't have any explanation for why this was removed in the code or git
history - it just disappears.
if (note) { | ||
note.data.deleted = true; | ||
noteBucket.update(note.id, note.data); | ||
|
||
dispatch(this.action('closeNote', { previousIndex })); |
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.
Are we removing the functionality that the previousIndex
provided?
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.
Looks like this was broken in #1851 so it won't appear in testing of this PR
In #1895 we added an import to `./state` that should have been `../state`. This didn't break the app because the import only affected the types. In this patch we're fixing the import path.
In #1895 we added an import to `./state` that should have been `../state`. This didn't break the app because the import only affected the types. In this patch we're fixing the import path.
Fix
Refactors
closeNote
moving the function from the flux actions to Redux. In doing this it required the removal of the note list open/closed that was being stored in the component state of app.tsx.Test