@Component({
selector: 'my-video-comment-add',
templateUrl: './video-comment-add.component.html',
- styleUrls: ['./video-comment-add.component.scss']
+ styleUrls: [ './video-comment-add.component.scss' ]
})
export class VideoCommentAddComponent extends FormReactive implements OnChanges, OnInit {
@Input() user: User
for (const emojiMarkupName in emojiMarkupObjectList) {
if (emojiMarkupName) {
const emoji = emojiMarkupObjectList[emojiMarkupName]
- emojiMarkupArrayList.push([emoji, emojiMarkupName])
+ emojiMarkupArrayList.push([ emoji, emojiMarkupName ])
}
}
// Not initialized yet
if (!this.form) return
- if (changes.textValue && changes.textValue.currentValue && changes.textValue.currentValue !== changes.textValue.previousValue) {
+ if (changes.textValue?.currentValue && changes.textValue.currentValue !== changes.textValue.previousValue) {
this.patchTextValue(changes.textValue.currentValue, true)
}
}
onValidKey () {
- this.check()
+ this.forceCheck()
if (!this.form.valid) return
this.formValidated()
obs = this.addCommentThread(commentCreate)
}
- obs.subscribe(
- comment => {
+ obs.subscribe({
+ next: comment => {
this.addingComment = false
this.commentCreated.emit(comment)
this.form.reset()
},
- err => {
+ error: err => {
this.addingComment = false
this.notifier.error(err.text)
}
- )
+ })
}
isAddButtonDisplayed () {
private addCommentReply (commentCreate: VideoCommentCreate) {
return this.videoCommentService
- .addCommentReply(this.video.id, this.parentComment.id, commentCreate)
+ .addCommentReply(this.video.uuid, this.parentComment.id, commentCreate)
}
private addCommentThread (commentCreate: VideoCommentCreate) {
return this.videoCommentService
- .addCommentThread(this.video.id, commentCreate)
+ .addCommentThread(this.video.uuid, commentCreate)
}
private initTextValue () {