diff --git a/.boostnoterc.sample b/.boostnoterc.sample
index a7981f7f..2d581a48 100644
--- a/.boostnoterc.sample
+++ b/.boostnoterc.sample
@@ -22,7 +22,9 @@
"fontSize": "14",
"lineNumber": true
},
- "sortBy": "UPDATED_AT",
+ "sortBy": {
+ "default": "UPDATED_AT"
+ },
"sortTagsBy": "ALPHABETICAL",
"ui": {
"defaultNote": "ALWAYS_ASK",
diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js
index eeb16a5f..f7dd0764 100644
--- a/browser/main/NoteList/index.js
+++ b/browser/main/NoteList/index.js
@@ -418,10 +418,10 @@ class NoteList extends React.Component {
}
handleSortByChange (e) {
- const { dispatch } = this.props
+ const { dispatch, params: { folderKey } } = this.props
const config = {
- sortBy: e.target.value
+ [folderKey]: { sortBy: e.target.value }
}
ConfigManager.set(config)
@@ -909,12 +909,13 @@ class NoteList extends React.Component {
}
render () {
- const { location, config } = this.props
+ const { location, config, params: { folderKey } } = this.props
let { notes } = this.props
const { selectedNoteKeys } = this.state
- const sortFunc = config.sortBy === 'CREATED_AT'
+ const sortBy = _.get(config, [folderKey, 'sortBy'], config.sortBy.default)
+ const sortFunc = sortBy === 'CREATED_AT'
? sortByCreatedAt
- : config.sortBy === 'ALPHABETICAL'
+ : sortBy === 'ALPHABETICAL'
? sortByAlphabetical
: sortByUpdatedAt
const sortedNotes = location.pathname.match(/\/starred|\/trash/)
@@ -965,7 +966,7 @@ class NoteList extends React.Component {
notes.length === 1 ||
(autoSelectFirst && index === 0)
const dateDisplay = moment(
- config.sortBy === 'CREATED_AT'
+ sortBy === 'CREATED_AT'
? note.createdAt : note.updatedAt
).fromNow('D')
@@ -1014,7 +1015,7 @@ class NoteList extends React.Component {