Skip to content
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

【Suggestion】Show restore menu when select trashed note #290

Merged
merged 4 commits into from Jan 14, 2020

Conversation

funzin
Copy link
Contributor

@funzin funzin commented Jan 13, 2020

Problem

Regardless of whether it has been deleted, the following menu is displayed when select note item.

- Duplicate
- Delete
- Bookmark | Remove bookmark

But I think Duplicate and Bookmark | Remove bookmark menu should not be shown when select trashed note.

Suggestion

When select trashed note, the following menu is desirable

- Delete
- Restore

Restore behaves the same as tapping untrashed icon

Change

  • Add note.restore( some language I didn't understand remains Restore)
  • Show restore and delete menu when note.trashed is true(not show duplicate and bookmark menu)

GIF

demo

@Rokt33r
Copy link
Member

Rokt33r commented Jan 14, 2020

LGTM I'll review it today!

Copy link
Member

@Rokt33r Rokt33r left a comment

Choose a reason for hiding this comment

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

LGTM! But I find a minor issue.

I probably try to release app today. If you are not possible to resolve this change request in 5 hours, I'll fix it by myself and push it to this pr.

if (value === 0) {
purgeNote(note.storageId, note._id)

let menuItems: MenuItem[]
Copy link
Member

Choose a reason for hiding this comment

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

Rather than using let and if statement, I would use const and a ternary operator.

const menuItems: MenuItem[] = note.trashed ? [...] : [...]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks to fix my code:pray:

@Rokt33r
Copy link
Member

Rokt33r commented Jan 14, 2020

Thanks for your contribution!

@Rokt33r Rokt33r merged commit ec98b18 into BoostIO:master Jan 14, 2020
@Rokt33r Rokt33r added this to the v0.1.4 milestone Jan 14, 2020
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.

None yet

2 participants