Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1435 from atom/aw/stop-selection-sync
Browse files Browse the repository at this point in the history
Reset mouseSelectionInProgress synchronously on mouseUp
  • Loading branch information
smashwilson authored May 4, 2018
2 parents dff74ba + 324e08c commit fbaf0d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/views/staging-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -778,15 +778,17 @@ export default class StagingView extends React.Component {
}

async mouseup() {
const hadSelectionInProgress = this.mouseSelectionInProgress;
this.mouseSelectionInProgress = false;

await new Promise(resolve => {
this.setState(prevState => ({
selection: prevState.selection.coalesce(),
}), resolve);
});
if (this.mouseSelectionInProgress) {
if (hadSelectionInProgress) {
this.debouncedDidChangeSelectedItem(true);
}
this.mouseSelectionInProgress = false;
}

undoLastDiscard() {
Expand Down

0 comments on commit fbaf0d4

Please sign in to comment.