0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-10 04:52:40 +00:00

update response handling for saving google brews

This commit is contained in:
Charlie Humphreys
2022-03-29 11:46:50 -05:00
parent e9cf7be488
commit 89dbd19556
2 changed files with 38 additions and 38 deletions

View File

@@ -276,26 +276,26 @@ const EditPage = createClass({
console.log(errMsg); console.log(errMsg);
} catch (e){} } catch (e){}
if(this.state.errors.status == '401'){ // if(this.state.errors.status == '401'){
return <Nav.item className='save error' icon='fas fa-exclamation-triangle'> // return <Nav.item className='save error' icon='fas fa-exclamation-triangle'>
Oops! // Oops!
<div className='errorContainer' onClick={this.clearErrors}> // <div className='errorContainer' onClick={this.clearErrors}>
You must be signed in to a Google account // You must be signed in to a Google account
to save this to<br />Google Drive!<br /> // to save this to<br />Google Drive!<br />
<a target='_blank' rel='noopener noreferrer' // <a target='_blank' rel='noopener noreferrer'
href={`https://www.naturalcrit.com/login?redirect=${this.state.url}`}> // href={`https://www.naturalcrit.com/login?redirect=${this.state.url}`}>
<div className='confirm'> // <div className='confirm'>
Sign In // Sign In
</div> // </div>
</a> // </a>
<div className='deny'> // <div className='deny'>
Not Now // Not Now
</div> // </div>
</div> // </div>
</Nav.item>; // </Nav.item>;
} // }
if(this.state.errors.response.req.url.match(/^\/api\/.*Google.*$/m)){ if(this.state.errors.response.req.url.match(/^\/api\/.*transfer.*$/m)){
return <Nav.item className='save error' icon='fas fa-exclamation-triangle'> return <Nav.item className='save error' icon='fas fa-exclamation-triangle'>
Oops! Oops!
<div className='errorContainer' onClick={this.clearErrors}> <div className='errorContainer' onClick={this.clearErrors}>

View File

@@ -187,26 +187,26 @@ const NewPage = createClass({
console.log(errMsg); console.log(errMsg);
} catch (e){} } catch (e){}
if(this.state.errors.status == '401'){ // if(this.state.errors.status == '401'){
return <Nav.item className='save error' icon='fas fa-exclamation-triangle'> // return <Nav.item className='save error' icon='fas fa-exclamation-triangle'>
Oops! // Oops!
<div className='errorContainer' onClick={this.clearErrors}> // <div className='errorContainer' onClick={this.clearErrors}>
You must be signed in to a Google account // You must be signed in to a Google account
to save this to<br />Google Drive!<br /> // to save this to<br />Google Drive!<br />
<a target='_blank' rel='noopener noreferrer' // <a target='_blank' rel='noopener noreferrer'
href={`https://www.naturalcrit.com/login?redirect=${this.state.url}`}> // href={`https://www.naturalcrit.com/login?redirect=${this.state.url}`}>
<div className='confirm'> // <div className='confirm'>
Sign In // Sign In
</div> // </div>
</a> // </a>
<div className='deny'> // <div className='deny'>
Not Now // Not Now
</div> // </div>
</div> // </div>
</Nav.item>; // </Nav.item>;
} // }
if(this.state.errors.response.req.url.match(/^\/api\/.*Google.*$/m)){ if(this.state.errors.response.req.url.match(/^\/api\/.*transfer.*$/m)){
return <Nav.item className='save error' icon='fas fa-exclamation-triangle'> return <Nav.item className='save error' icon='fas fa-exclamation-triangle'>
Oops! Oops!
<div className='errorContainer' onClick={this.clearErrors}> <div className='errorContainer' onClick={this.clearErrors}>