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) {
|
componentWillReceiveProps (nextProps) {
|
||||||
if (nextProps.note.key !== this.props.note.key) {
|
if (nextProps.note.key !== this.props.note.key) {
|
||||||
if (this.state.isDispatchQueued) {
|
if (this.state.isDispatchQueued) {
|
||||||
|
this.cancelDispatchQueue()
|
||||||
this.dispatch()
|
this.dispatch()
|
||||||
}
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -92,7 +93,7 @@ class NoteDetail extends React.Component {
|
|||||||
this.setState({
|
this.setState({
|
||||||
isDispatchQueued: false
|
isDispatchQueued: false
|
||||||
})
|
})
|
||||||
}, 500)
|
}, 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch () {
|
dispatch () {
|
||||||
|
|||||||
Reference in New Issue
Block a user