diff --git a/js/src/forum/components/PollForm.tsx b/js/src/forum/components/PollForm.tsx index 9fa9df47..0a7968b0 100644 --- a/js/src/forum/components/PollForm.tsx +++ b/js/src/forum/components/PollForm.tsx @@ -26,7 +26,7 @@ export default class PollForm extends Component { protected optionImageUrls: Stream[] = []; protected question: Stream; protected subtitle: Stream; - protected pollImage: Stream; + protected image: Stream; protected imageAlt: Stream; protected endDate: Stream; protected publicPoll: Stream; @@ -49,7 +49,7 @@ export default class PollForm extends Component { this.question = Stream(poll.question()); this.subtitle = Stream(poll.subtitle()); - this.pollImage = Stream(poll.imageUrl()); + this.image = Stream(poll.image()); this.imageAlt = Stream(poll.imageAlt()); this.endDate = Stream(this.formatDate(poll.endDate())); this.publicPoll = Stream(poll.publicPoll()); @@ -105,12 +105,12 @@ export default class PollForm extends Component {

{app.translator.trans('fof-polls.forum.modal.poll_image.help')}

- + , 90 ); - if (this.pollImage()) { + if (this.image()) { items.add( 'poll_image_alt',
@@ -332,7 +332,7 @@ export default class PollForm extends Component { return { question: this.question(), subtitle: this.subtitle(), - pollImage: this.pollImage(), + pollImage: this.image(), imageAlt: this.imageAlt(), endDate: this.dateToTimestamp(this.endDate()) ?? false, publicPoll: this.publicPoll(), @@ -388,6 +388,6 @@ export default class PollForm extends Component { } pollImageUploadSuccess(fileName: string | null | undefined): void { - this.pollImage(fileName); + this.image(fileName); } } diff --git a/js/src/forum/models/Poll.ts b/js/src/forum/models/Poll.ts index 80f5cfa4..22777852 100755 --- a/js/src/forum/models/Poll.ts +++ b/js/src/forum/models/Poll.ts @@ -14,6 +14,10 @@ export default class Poll extends Model { return Model.attribute('subtitle').call(this); } + image() { + return Model.attribute('image').call(this); + } + imageUrl() { return Model.attribute('imageUrl').call(this); }