Remove unnecessary and broken isReloading from settings modal
It could lockup the website if location.reload fails for whatever reason
This commit is contained in:
3 files changed
+2
-18
No files matched your search
@@ -16,13 +16,6 @@
|
||||
background: $ui-primary;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
pointer-events: none;
|
||||
}
|
||||
.disabled > * {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.setting {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -363,7 +363,7 @@ const SettingsModalComponent = props => (
|
||||
contentLabel={props.intl.formatMessage(messages.title)}
|
||||
id="settingsModal"
|
||||
>
|
||||
<Box className={classNames(styles.body, {[styles.disabled]: props.disabled})}>
|
||||
<Box className={styles.body}>
|
||||
<Header>
|
||||
<FormattedMessage
|
||||
defaultMessage="Featured"
|
||||
@@ -429,7 +429,6 @@ SettingsModalComponent.propTypes = {
|
||||
intl: intlShape,
|
||||
onClose: PropTypes.func,
|
||||
reloadRequired: PropTypes.bool,
|
||||
disabled: PropTypes.bool,
|
||||
framerate: PropTypes.number,
|
||||
onFramerateChange: PropTypes.func,
|
||||
onCustomizeFramerate: PropTypes.func,
|
||||
|
||||
@@ -42,21 +42,14 @@ class UsernameModal extends React.Component {
|
||||
this.state = {
|
||||
stageWidth: twStageSize.width,
|
||||
stageHeight: twStageSize.height,
|
||||
reloadRequired: false,
|
||||
isReloading: false
|
||||
reloadRequired: false
|
||||
};
|
||||
}
|
||||
handleClose () {
|
||||
if (this.state.isReloading) {
|
||||
return;
|
||||
}
|
||||
if (this.state.reloadRequired) {
|
||||
// eslint-disable-next-line no-alert
|
||||
if (confirm(this.props.intl.formatMessage(messages.confirmReload))) {
|
||||
this.applyChangesThatNeedReload();
|
||||
this.setState({
|
||||
isReloading: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -137,7 +130,6 @@ class UsernameModal extends React.Component {
|
||||
return (
|
||||
<SettingsModalComponent
|
||||
onClose={this.handleClose}
|
||||
disabled={this.state.isReloading}
|
||||
reloadRequired={this.state.reloadRequired}
|
||||
onFramerateChange={this.handleFramerateChange}
|
||||
onCustomizeFramerate={this.handleCustomizeFramerate}
|
||||
|
||||
Reference in new issue
Block a user