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:
Thomas Weber committed 2021-04-02 12:55:05 -05:00
1 parent 620aefd20e
commit 4ed3e69866
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,
+1 -9
View File
@@ -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}