1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-02 22:49:09 +02:00

Fixed note order in RN

This commit is contained in:
Laurent Cozic
2017-07-15 19:13:31 +01:00
parent 62c9a66c47
commit 93791f1e46
6 changed files with 56 additions and 3 deletions

View File

@@ -44,6 +44,10 @@ let defaultState = {
screens: {},
loading: true,
historyCanGoBack: false,
notesOrder: {
orderBy: 'updated_time',
orderByDir: 'DESC',
},
};
const initialRoute = {
@@ -161,6 +165,7 @@ const reducer = (state = defaultState, action) => {
if (!found) newNotes.push(action.note);
newNotes = Note.sortNotes(newNotes, state.notesOrder);
newState = Object.assign({}, state);
newState.notes = newNotes;
break;
@@ -288,6 +293,7 @@ async function initialize(dispatch, backButtonHandler) {
BaseModel.dispatch = dispatch;
NotesScreenUtils.dispatch = dispatch;
NotesScreenUtils.store = store;
FoldersScreenUtils.dispatch = dispatch;
BaseModel.db_ = db;