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

New note is placed incorrectly with reversed sorting #43

Open
citomcclure opened this issue Jun 18, 2024 · 0 comments
Open

New note is placed incorrectly with reversed sorting #43

citomcclure opened this issue Jun 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@citomcclure
Copy link
Owner

Description

When reversed sorting is applied, new notes are still added to the top of the note previews list. This is because in ViewNotes.createNote(), we have:

// Add new note in datastore
const notes = await this.dataStore.get('notes');
notes.unshift(newNote);
this.dataStore.set('notes', notes);

Steps to Reproduce

  1. Have more than one note
  2. Change Sort By to "Oldest First"
  3. Click "New Note"

Recommended Fix

Create datastore state for sort, which can be accessed by methods like createNote() to determine if new note is added to the beginning or end of the list.

@citomcclure citomcclure added the bug Something isn't working label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Ready
Development

No branches or pull requests

1 participant