delete: delete your account error messaging fix

This commit is contained in:
@wwwjim 2020-09-12 19:59:47 -07:00
parent 7fad819d13
commit 559f5c3c48
2 changed files with 16 additions and 13 deletions

View File

@ -340,9 +340,23 @@ export default class ApplicationPage extends React.Component {
} }
let response = await Actions.deleteViewer(); let response = await Actions.deleteViewer();
console.log("DELETE_VIEWER", response);
if (!response || response.error) {
dispatchCustomEvent({
name: "create-alert",
detail: {
alert: {
message:
"We're having trouble connecting right now. Please try again later",
},
},
});
return response;
}
await this._handleSignOut(); await this._handleSignOut();
return response;
}; };
_handleAuthenticate = async (state) => { _handleAuthenticate = async (state) => {

View File

@ -182,18 +182,7 @@ export default class SceneEditAccount extends React.Component {
await delay(100); await delay(100);
const response = await this.props.onDeleteYourself(); const response = await this.props.onDeleteYourself();
if (!response) { this.setState({ deleting: false });
dispatchCustomEvent({
name: "create-alert",
detail: {
alert: {
message:
"We're having trouble connecting right now. Please try again later",
},
},
});
this.setState({ deleting: false });
}
}; };
_handleChange = (e) => { _handleChange = (e) => {