From 267fdc176043d3cd5aaefdc21df90675c0a74dd5 Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Wed, 24 Feb 2016 18:04:42 -0800 Subject: [PATCH] fix(toggle): Will always turn off read receipt config on error --- src/components/metadata-composer-toggle-button.jsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/components/metadata-composer-toggle-button.jsx b/src/components/metadata-composer-toggle-button.jsx index 22e1cf295..2db6af9ce 100644 --- a/src/components/metadata-composer-toggle-button.jsx +++ b/src/components/metadata-composer-toggle-button.jsx @@ -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; }