Browse Source

Fixed story chapters being unresponsive if there are no comments.

master 1.3.0
Gisle Aune 6 years ago
parent
commit
853076fd5e
  1. 4
      marko/page/story-content/components/create-comment-modal/component.js

4
marko/page/story-content/components/create-comment-modal/component.js

@ -30,11 +30,13 @@ module.exports = class {
const comments = this.input.chapter.comments || [] const comments = this.input.chapter.comments || []
const lastComment = comments[comments.length - 1] const lastComment = comments[comments.length - 1]
let date = lastComment.fictionalDate || chapter.fictionalDate
if (lastComment != null) {
let date = lastComment.fictionalDate || this.input.chapter.fictionalDate
if (date != null) { if (date != null) {
this.change("fictionalDate", {target: {value: moment(date).format("MMM D, YYYY")}}) this.change("fictionalDate", {target: {value: moment(date).format("MMM D, YYYY")}})
} }
} }
}
change(key, ev) { change(key, ev) {
this.state.values = Object.assign({}, this.state.values, {[key]: ev.target.value}) this.state.values = Object.assign({}, this.state.values, {[key]: ev.target.value})

Loading…
Cancel
Save