diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index a24212f..62a3e8f 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/src/app/BoardThreads/op/op.component.html b/src/app/BoardThreads/op/op.component.html index d3427b1..713f137 100644 --- a/src/app/BoardThreads/op/op.component.html +++ b/src/app/BoardThreads/op/op.component.html @@ -1,5 +1,6 @@

Тред номер {{op.Thread_Id}}

+ Тред номер {{op.Thread_Id}}

# {{op.Id}} {{op.Timestamp}}

diff --git a/src/app/SingleThread/boards.component.ts b/src/app/SingleThread/boards.component.ts index cfb68d3..2314994 100644 --- a/src/app/SingleThread/boards.component.ts +++ b/src/app/SingleThread/boards.component.ts @@ -2,6 +2,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { ApiChatService } from '../services/api-chat.service'; import { SinglePost } from '../models/post' import * as vars from '../var/api' +import {ActivatedRoute} from "@angular/router"; @Component({ selector: 'app-SingleThread', @@ -16,10 +17,11 @@ export class BoardsComponent implements OnInit { displayed_thread_number = vars.displayed_thread; showGuide: boolean = false; - constructor(public apiChatService: ApiChatService) { + constructor(public apiChatService: ApiChatService, private activatedRoute:ActivatedRoute) { } + refreshPosts(boardName: string , threadId:number) { this.apiChatService.getPosts(boardName, threadId).subscribe(response => { this.postsToShow = response @@ -28,7 +30,12 @@ export class BoardsComponent implements OnInit { } ngOnInit(): void { - this.apiChatService.getPosts('postgres', vars.displayed_thread).subscribe(response => { + var threadId = this.activatedRoute.snapshot.queryParamMap.get('thread'); + if(threadId != null) + { + this.displayed_thread_number = parseInt(threadId); + } + this.apiChatService.getPosts('postgres', this.displayed_thread_number).subscribe(response => { this.postsToShow = response }) } diff --git a/src/app/var/api.ts b/src/app/var/api.ts index 842f10b..935d10a 100644 --- a/src/app/var/api.ts +++ b/src/app/var/api.ts @@ -1,6 +1,6 @@ -export const api_endpoint: string = 'http://api.vdk2ch.ru:5000/'; -//export const api_endpoint: string = 'http://localhost:7141/'; -export var displayed_thread: number = 2; +//export const api_endpoint: string = 'http://api.vdk2ch.ru:5000/'; +export const api_endpoint: string = 'http://localhost:7141/'; +export var displayed_thread: number; export function setDisplayedThread(toset:number){ displayed_thread = toset; };