1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

fix minor bugs

fix codemirror bug
fix style bug of in NoteList
fix Redux store bug: Cruch on deleting empty folder
This commit is contained in:
Dick Choi
2016-10-13 15:47:25 +09:00
parent ed5f3a6202
commit 2fdea6cd61
4 changed files with 29 additions and 27 deletions

View File

@@ -98,8 +98,8 @@ export default class CodeEditor extends React.Component {
}
handleChange (e) {
this.value = this.editor.getValue()
if (this.props.onChange) {
this.value = this.editor.getValue()
this.props.onChange(e)
}
}
@@ -121,6 +121,7 @@ export default class CodeEditor extends React.Component {
reload () {
// Change event shouldn't be fired when switch note
this.editor.off('change', this.changeHandler)
this.value = this.props.value
this.editor.setValue(this.props.value)
this.editor.clearHistory()
this.editor.on('change', this.changeHandler)

View File

@@ -16,6 +16,7 @@ class StorageSection extends React.Component {
isOpen: !this.state.isOpen
})
}
handleHeaderClick (e) {
let { storage } = this.props
this.props.handleStorageButtonClick(e, storage.key)

View File

@@ -74,13 +74,10 @@
background-color alpha($ui-active-color, 100%)
color white
.item-title
color white
.item-title-empty
.item-title-icon
color white
.item-bottom-tagIcon
color white
.item-bottom-tagList-empty
color white
.item-bottom-time
color white
.item-bottom-tagList-item

View File

@@ -330,31 +330,34 @@ function data (state = defaultDataMap(), action) {
let storageNoteSet = state.storageNoteMap.get(action.storage.key)
storageNoteSet = new Set(storageNoteSet)
state.storageNoteMap.set(action.storage.key, storageNoteSet)
noteSet.forEach(function handleNoteKey (noteKey) {
// Get note from noteMap
let note = state.noteMap.get(noteKey)
if (note != null) {
state.noteMap.delete(noteKey)
// From storageSet
storageNoteSet.delete(noteKey)
if (noteSet != null) {
noteSet.forEach(function handleNoteKey (noteKey) {
// Get note from noteMap
let note = state.noteMap.get(noteKey)
if (note != null) {
state.noteMap.delete(noteKey)
// From starredSet
if (note.isStarred) {
state.starredSet = new Set(state.starredSet)
state.starredSet.delete(noteKey)
// From storageSet
storageNoteSet.delete(noteKey)
// From starredSet
if (note.isStarred) {
state.starredSet = new Set(state.starredSet)
state.starredSet.delete(noteKey)
}
// Delete key from tag map
state.tagNoteMap = new Map(state.tagNoteMap)
note.tags.forEach((tag) => {
let tagNoteSet = state.tagNoteMap.get(tag)
tagNoteSet = new Set(tagNoteSet)
state.tagNoteMap.set(tag, tagNoteSet)
tagNoteSet.delete(noteKey)
})
}
// Delete key from tag map
state.tagNoteMap = new Map(state.tagNoteMap)
note.tags.forEach((tag) => {
let tagNoteSet = state.tagNoteMap.get(tag)
tagNoteSet = new Set(tagNoteSet)
state.tagNoteMap.set(tag, tagNoteSet)
tagNoteSet.delete(noteKey)
})
}
})
})
}
}
return state
case 'ADD_STORAGE':