diff --git a/src/app/BoardThreads/op/op.component.html b/src/app/BoardThreads/op/op.component.html index 713f137..4003df4 100644 --- a/src/app/BoardThreads/op/op.component.html +++ b/src/app/BoardThreads/op/op.component.html @@ -1,6 +1,5 @@
-

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

- Тред номер {{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 2314994..8cfbe18 100644 --- a/src/app/SingleThread/boards.component.ts +++ b/src/app/SingleThread/boards.component.ts @@ -3,6 +3,7 @@ import { ApiChatService } from '../services/api-chat.service'; import { SinglePost } from '../models/post' import * as vars from '../var/api' import {ActivatedRoute} from "@angular/router"; +import {setDisplayedThread} from "../var/api"; @Component({ selector: 'app-SingleThread', @@ -34,6 +35,7 @@ export class BoardsComponent implements OnInit { if(threadId != null) { this.displayed_thread_number = parseInt(threadId); + vars.setDisplayedThread(this.displayed_thread_number); } this.apiChatService.getPosts('postgres', this.displayed_thread_number).subscribe(response => { this.postsToShow = response diff --git a/src/app/send-post/send-post.component.html b/src/app/send-post/send-post.component.html index 9ae10d7..45cf52d 100644 --- a/src/app/send-post/send-post.component.html +++ b/src/app/send-post/send-post.component.html @@ -1,7 +1,7 @@

Поведай миру что-нибудь хорошее.


- +

diff --git a/src/app/send-post/send-post.component.ts b/src/app/send-post/send-post.component.ts index 6372e1e..79ad920 100644 --- a/src/app/send-post/send-post.component.ts +++ b/src/app/send-post/send-post.component.ts @@ -11,7 +11,7 @@ import * as vars from "../var/api"; export class SendPostComponent implements OnInit { progress: number; - message: string; + message: string = ''; filename: string[] = []; constructor( @@ -24,10 +24,13 @@ export class SendPostComponent implements OnInit { sendPost(text: string) { var threadId = vars.displayed_thread; - this.apiChatService.sendPostToApi(text, this.filename, threadId).subscribe(); + this.apiChatService.sendPostToApi(text, this.filename, threadId).subscribe( response => { + response = response.toString(); + vars.showAlert(response.toString(), "#ff0a36"); + }); this.message = '0'; this.filename = []; - alert("Сообщение отправлено."); + } @@ -37,7 +40,7 @@ export class SendPostComponent implements OnInit { response => { response = response.value.toString(); this.filename.push(response); - vars.showAlert("Картинка " + response + " добавлена к посту!", "#696116") + vars.showAlert("Картинка " + response + " добавлена к посту!", "#ff0a36") }); } diff --git a/src/app/var/api.ts b/src/app/var/api.ts index b75f68a..dbbd11c 100644 --- a/src/app/var/api.ts +++ b/src/app/var/api.ts @@ -13,9 +13,9 @@ const showAlert = (message:string, color:string) => { alertContainer.style.left = '50'; alertContainer.style.top = '0'; alertContainer.style.right = '0'; - alertContainer.style.padding = '10px 3px'; - alertContainer.style.fontSize = '30px'; - alertContainer.style.textAlign = 'center'; + alertContainer.style.padding = '30px 3px'; + alertContainer.style.fontSize = '20px'; + alertContainer.style.textAlign = 'right'; alertContainer.style.backgroundColor = color; alertContainer.style.border = "2px dashed #6CFFDD" alertContainer.textContent = message;