mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-31 15:12:39 +00:00
update API and frontend for google drive document stubs
This commit is contained in:
@@ -16,8 +16,8 @@ const BrewItem = createClass({
|
||||
brew : {
|
||||
title : '',
|
||||
description : '',
|
||||
|
||||
authors : []
|
||||
authors : [],
|
||||
stubbed : true
|
||||
}
|
||||
};
|
||||
},
|
||||
@@ -50,7 +50,7 @@ const BrewItem = createClass({
|
||||
if(!this.props.brew.editId) return;
|
||||
|
||||
let editLink = this.props.brew.editId;
|
||||
if(this.props.brew.googleId) {
|
||||
if(this.props.brew.googleId && !this.props.brew.stubbed) {
|
||||
editLink = this.props.brew.googleId + editLink;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ const BrewItem = createClass({
|
||||
if(!this.props.brew.shareId) return;
|
||||
|
||||
let shareLink = this.props.brew.shareId;
|
||||
if(this.props.brew.googleId) {
|
||||
if(this.props.brew.googleId && !this.props.brew.stubbed) {
|
||||
shareLink = this.props.brew.googleId + shareLink;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ const BrewItem = createClass({
|
||||
},
|
||||
|
||||
renderGoogleDriveIcon : function(){
|
||||
if(!this.props.brew.gDrive) return;
|
||||
if(!this.props.brew.googleId) return;
|
||||
|
||||
return <span>
|
||||
<img className='googleDriveIcon' src={googleDriveIcon} alt='googleDriveIcon' />
|
||||
@@ -104,8 +104,8 @@ const BrewItem = createClass({
|
||||
</div>
|
||||
<hr />
|
||||
<div className='info'>
|
||||
<span title={`Authors:\n${brew.authors.join('\n')}`}>
|
||||
<i className='fas fa-user'/> {brew.authors.join(', ')}
|
||||
<span title={`Authors:\n${brew.authors?.join('\n')}`}>
|
||||
<i className='fas fa-user'/> {brew.authors?.join(', ')}
|
||||
</span>
|
||||
<br />
|
||||
<span title={`Last viewed: ${moment(brew.lastViewed).local().format(dateFormatString)}`}>
|
||||
|
||||
@@ -211,7 +211,7 @@ const EditPage = createClass({
|
||||
|
||||
this.savedBrew = res.body;
|
||||
if(transfer) {
|
||||
history.replaceState(null, null, `/edit/${this.savedBrew.googleId ?? ''}${this.savedBrew.editId}`);
|
||||
history.replaceState(null, null, `/edit/${this.savedBrew.editId}`);
|
||||
}
|
||||
|
||||
this.setState((prevState)=>({
|
||||
|
||||
@@ -174,7 +174,7 @@ const NewPage = createClass({
|
||||
localStorage.removeItem(BREWKEY);
|
||||
localStorage.removeItem(STYLEKEY);
|
||||
localStorage.removeItem(METAKEY);
|
||||
window.location = `/edit/${brew.googleId ?? ''}${brew.editId}`;
|
||||
window.location = `/edit/${brew.editId}`;
|
||||
},
|
||||
|
||||
renderSaveButton : function(){
|
||||
|
||||
Reference in New Issue
Block a user