Skip to content

Commit

Permalink
Allow the user to dismiss the modal
Browse files Browse the repository at this point in the history
I am not convinced this is an entirely good idea, as why bother
with a blocking modal at all if a user can dismiss. The main hope
is that less technical users will simply respect the modal and wait
until completion before moving on. The risk is that users will
catch on and disregard the warning, allowing for potential footguns.
However, reviewers appear hostile to a blocking modal which cannot
be readily dismissed.
  • Loading branch information
kgryte committed May 19, 2020
1 parent b0a1c44 commit c51a449
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export class Toolbar extends React.Component<IToolbarProps, IToolbarState> {
return null;
}
return (
<Modal open={this.state.suspend}>
<Modal open={this.state.suspend} onClick={this._onFeedbackModalClick}>
<CircularProgress className={fullscreenProgressClass} color="inherit" />
</Modal>
);
Expand Down Expand Up @@ -435,4 +435,13 @@ export class Toolbar extends React.Component<IToolbarProps, IToolbarState> {
await Promise.all([sleep(1000), this.props.refresh()]);
this._suspend(false);
};

/**
* Callback invoked upon clicking on the feedback modal.
*
* @param event - event object
*/
private _onFeedbackModalClick = (): void => {
this._suspend(false);
};
}

0 comments on commit c51a449

Please sign in to comment.