mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
// filterを使うと確実にFolder名が一致するもののみを表示する
This commit is contained in:
@@ -29,7 +29,8 @@ function folders (state = initialFolders, action) {
|
||||
updatedAt: new Date()
|
||||
})
|
||||
|
||||
if (newFolder.length === 0) throw new Error('Folder name is required')
|
||||
if (newFolder.name == null && newFolder.name.length === 0) throw new Error('Folder name is required')
|
||||
if (newFolder.name.match(/\//)) throw new Error('`/` is not available for folder name')
|
||||
|
||||
let conflictFolder = _.findWhere(state, {name: newFolder.name})
|
||||
if (conflictFolder != null) throw new Error(`${newFolder.name} already exists!`)
|
||||
@@ -129,7 +130,7 @@ function status (state = initialStatus, action) {
|
||||
return state
|
||||
case SWITCH_FOLDER:
|
||||
state.mode = IDLE_MODE
|
||||
state.search = `/${action.data} `
|
||||
state.search = `//${action.data} `
|
||||
|
||||
return state
|
||||
case SWITCH_MODE:
|
||||
|
||||
Reference in New Issue
Block a user