Thread now refreshes after sending the message.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
RakVhalate 2022-11-26 20:11:02 +10:00
parent fb2ea59afb
commit eb577cc056
2 changed files with 12 additions and 6 deletions

View File

@ -18,11 +18,12 @@ export class BoardsComponent implements OnInit {
displayed_thread_number = vars.displayed_thread; displayed_thread_number = vars.displayed_thread;
showGuide: boolean = false; showGuide: boolean = false;
constructor(public apiChatService: ApiChatService, private activatedRoute:ActivatedRoute) { constructor(
public apiChatService: ApiChatService,
private activatedRoute:ActivatedRoute
){
} }
refreshPosts(boardName: string , threadId:number) { refreshPosts(boardName: string , threadId:number) {
this.apiChatService.getPosts(boardName, threadId).subscribe(response => { this.apiChatService.getPosts(boardName, threadId).subscribe(response => {
this.postsToShow = response this.postsToShow = response

View File

@ -1,5 +1,6 @@
import { Component, EventEmitter, OnInit, Output } from '@angular/core'; import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { ApiChatService } from '../services/api-chat.service'; import { ApiChatService } from '../services/api-chat.service';
import {BoardsComponent} from "../SingleThread/boards.component";
import * as vars from "../var/api"; import * as vars from "../var/api";
@ -15,7 +16,8 @@ export class SendPostComponent implements OnInit {
filename: string[] = []; filename: string[] = [];
constructor( 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 => { this.apiChatService.sendPostToApi(text, this.filename, threadId).subscribe( response => {
response = response.toString(); response = response.toString();
vars.showAlert(response.toString(), "#ff0a36"); vars.showAlert(response.toString(), "#ff0a36");
this.refreshDisplayedThread();
}); });
this.message = '0'; this.message = '0';
this.filename = []; this.filename = [];
} }
@ -44,6 +45,10 @@ export class SendPostComponent implements OnInit {
}); });
} }
refreshDisplayedThread(){
this.boards.refreshPosts("b", vars.displayed_thread)
}
ngOnInit(): void { ngOnInit(): void {
} }