1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00
INIT_ALL, NOTE_MOVE, NOTE_UPDATE(create/update) done
This commit is contained in:
Dick Choi
2016-08-30 02:33:28 +09:00
parent ba374e08ff
commit aefb84df3b
13 changed files with 449 additions and 152 deletions

View File

@@ -33,9 +33,16 @@ class TopBar extends React.Component {
}
handleNewPostButtonClick (e) {
let { storages, params, dispatch, location } = this.props
let storage = _.find(storages, {key: params.storageKey})
if (storage == null) storage = storages[0]
let { data, params, dispatch, location } = this.props
let storage = data.storageMap.get(params.storageKey)
// Find first storage
if (storage == null) {
for (let kv of data.storageMap) {
storage = kv[1]
break
}
}
if (storage == null) throw new Error('No storage to create a note')
let folder = _.find(storage.folders, {key: params.folderKey})
if (folder == null) folder = storage.folders[0]