mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
cancel dispatch queue before focrcing & shorter dispatch latency
This commit is contained in:
@@ -22,6 +22,7 @@ class NoteDetail extends React.Component {
|
||||
componentWillReceiveProps (nextProps) {
|
||||
if (nextProps.note.key !== this.props.note.key) {
|
||||
if (this.state.isDispatchQueued) {
|
||||
this.cancelDispatchQueue()
|
||||
this.dispatch()
|
||||
}
|
||||
this.setState({
|
||||
@@ -92,7 +93,7 @@ class NoteDetail extends React.Component {
|
||||
this.setState({
|
||||
isDispatchQueued: false
|
||||
})
|
||||
}, 500)
|
||||
}, 100)
|
||||
}
|
||||
|
||||
dispatch () {
|
||||
|
||||
Reference in New Issue
Block a user