Thread now refreshes after sending the message.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
fb2ea59afb
commit
eb577cc056
@ -18,11 +18,12 @@ export class BoardsComponent implements OnInit {
|
||||
displayed_thread_number = vars.displayed_thread;
|
||||
showGuide: boolean = false;
|
||||
|
||||
constructor(public apiChatService: ApiChatService, private activatedRoute:ActivatedRoute) {
|
||||
constructor(
|
||||
public apiChatService: ApiChatService,
|
||||
private activatedRoute:ActivatedRoute
|
||||
){
|
||||
|
||||
}
|
||||
|
||||
|
||||
refreshPosts(boardName: string , threadId:number) {
|
||||
this.apiChatService.getPosts(boardName, threadId).subscribe(response => {
|
||||
this.postsToShow = response
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
|
||||
import { ApiChatService } from '../services/api-chat.service';
|
||||
import {BoardsComponent} from "../SingleThread/boards.component";
|
||||
import * as vars from "../var/api";
|
||||
|
||||
|
||||
@ -15,7 +16,8 @@ export class SendPostComponent implements OnInit {
|
||||
filename: string[] = [];
|
||||
|
||||
constructor(
|
||||
public apiChatService: ApiChatService
|
||||
public apiChatService: ApiChatService,
|
||||
private boards: BoardsComponent
|
||||
) {
|
||||
}
|
||||
|
||||
@ -27,11 +29,10 @@ export class SendPostComponent implements OnInit {
|
||||
this.apiChatService.sendPostToApi(text, this.filename, threadId).subscribe( response => {
|
||||
response = response.toString();
|
||||
vars.showAlert(response.toString(), "#ff0a36");
|
||||
this.refreshDisplayedThread();
|
||||
});
|
||||
this.message = '0';
|
||||
this.filename = [];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -44,6 +45,10 @@ export class SendPostComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
refreshDisplayedThread(){
|
||||
this.boards.refreshPosts("b", vars.displayed_thread)
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user