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

Unify brew structure in all pages

This commit is contained in:
Trevor Buckner
2021-02-20 21:59:18 -05:00
parent 009a11a9f5
commit 468b7319d1
5 changed files with 28 additions and 25 deletions

View File

@@ -18,7 +18,9 @@ const SNIPPETBAR_HEIGHT = 25;
const Editor = createClass({
getDefaultProps : function() {
return {
brew : {},
brew : {
text : ''
},
onChange : ()=>{},
onMetadataChange : ()=>{},

View File

@@ -50,7 +50,7 @@ const MetadataEditor = createClass({
},
handleDelete : function(){
if(this.props.metadata.authors.length <= 1){
if(this.props.metadata.authors && this.props.metadata.authors.length <= 1){
if(!confirm('Are you sure you want to delete this brew? Because you are the only owner of this brew, the document will be deleted permanently.')) return;
if(!confirm('Are you REALLY sure? You will not be able to recover the document.')) return;
} else {
@@ -114,7 +114,7 @@ const MetadataEditor = createClass({
renderAuthors : function(){
let text = 'None.';
if(this.props.metadata.authors.length){
if(this.props.metadata.authors && this.props.metadata.authors.length){
text = this.props.metadata.authors.join(', ');
}
return <div className='field authors'>