mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 15:56:10 +08:00
fix(toggle): Will always turn off read receipt config on error
This commit is contained in:
parent
db5c822ccf
commit
267fdc1760
|
@ -80,7 +80,7 @@ export default class MetadataComposerToggleButton extends React.Component {
|
|||
.catch((error) => {
|
||||
this.setState({enabled: false});
|
||||
|
||||
if (this._shouldStickFalseOnError(error)) {
|
||||
if (this.props.stickyToggle) {
|
||||
NylasEnv.config.set(this._configKey(), false)
|
||||
}
|
||||
|
||||
|
@ -100,11 +100,6 @@ export default class MetadataComposerToggleButton extends React.Component {
|
|||
});
|
||||
}
|
||||
|
||||
_shouldStickFalseOnError(error) {
|
||||
return this.props.stickyToggle && (error instanceof APIError) &&
|
||||
(NylasAPI.PermanentErrorCodes.indexOf(error.statusCode) === -1);
|
||||
}
|
||||
|
||||
_onClick = () => {
|
||||
// Toggle.
|
||||
if (this.state.pending) { return; }
|
||||
|
|
Loading…
Reference in a new issue