cabana: higher debounce interval for part change

main
Andy Haden 2017-07-07 15:06:47 -07:00
parent 76841a0ac7
commit 023736c5ad
1 changed files with 5 additions and 2 deletions

View File

@ -249,13 +249,16 @@ export default class CanExplorer extends Component {
} }
partChangeDebounced = debounce((part) => { partChangeDebounced = debounce((part) => {
this.spawnWorker(this.state.currentParts); const {currentParts} = this.state;
}, 250); this.spawnWorker(currentParts);
}, 500);
onPartChange(part) { onPartChange(part) {
let {currentParts, canFrameOffset} = this.state; let {currentParts, canFrameOffset} = this.state;
if(canFrameOffset === -1) { if(canFrameOffset === -1) {
return return
} }
const currentPartSpan = currentParts[1] - currentParts[0] + 1; const currentPartSpan = currentParts[1] - currentParts[0] + 1;
currentParts = [part, part + currentPartSpan - 1]; currentParts = [part, part + currentPartSpan - 1];
this.setState({currentParts, messages: {}, selectedMessage: null}, this.partChangeDebounced); this.setState({currentParts, messages: {}, selectedMessage: null}, this.partChangeDebounced);