Skip to content

Commit

Permalink
Merge pull request tapixhx#76 from tapixhx/modify
Browse files Browse the repository at this point in the history
Number of messages
  • Loading branch information
tapixhx authored Jun 10, 2020
2 parents 8bf0976 + 3d02fd1 commit 0fefaa4
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
4 changes: 2 additions & 2 deletions chat-client/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<router-outlet></router-outlet>
</div>
<app-footer></app-footer>
<!-- loader -->

<div *ngIf="load" class="loader-background">
<img src="../../assets/images/black-jc-logo.png" class="load-logo" alt="logo">
</div>
<!-- loader -->

3 changes: 2 additions & 1 deletion chat-client/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ export class AppComponent implements OnInit {
}

error(message) {
alert(message)
if(message=="jwt expired")
{
{
this.changeService.loginopen()
}
else
Expand Down
13 changes: 12 additions & 1 deletion chat-client/src/app/room/room.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ button:focus {
overflow: scroll;
padding-bottom:4rem;

}
.position
{
position:absolute;


}

.join-button,
Expand Down Expand Up @@ -579,6 +585,11 @@ button:focus {
{
padding: 10px 15px;
}
.text-box
{
height: 85vh;
}


}
@media only screen and (max-width: 376px) {
Expand All @@ -599,7 +610,7 @@ button:focus {
}
#session-header
{
text-align:left
text-align:center
}
.pd1 {
padding: 10px 15px;
Expand Down
7 changes: 4 additions & 3 deletions chat-client/src/app/room/room.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</div>
<div id="session-header">
<button class="normal-button text-center pd3" (click)="chat()"><img
src="../../assets/images/chat.png" class="image2" alt="chat"></button>
src="../../assets/images/chat.png" class="image2" alt="chat"><span *ngIf="countMessages" class="position">{{countMessages}}</span></button>
<button class="normal-button text-center pd1" (click)="videochange()"><img [src]="src"
class="image2" alt="video-off"></button>
<button class="leave-button text-center" (click)="leaveSession()"><img class="image"
Expand Down Expand Up @@ -149,9 +149,10 @@
</div>
</div>
</div>

<div class="text-box" [class.display]="show" [class.undisplay]="!show">
<div class="cross" (click)="chatClose()"><button class="btn btn-primary">X</button></div>
<div class="cross" (click)="chatClose()"><button class="btn btn-primary">X</button></div>

<div class="bottom">

<div class="text-box-padding" #scroll>
Expand Down
8 changes: 7 additions & 1 deletion chat-client/src/app/room/room.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export class RoomComponent implements OnInit, OnDestroy {
pub = true
exp: any;
local = false;
countMessages=0;
// Main video of the page, will be 'publisher' or one of the 'subscribers',
// updated by click event in UserVideoComponent children
mainStreamManager: StreamManager;
Expand Down Expand Up @@ -112,7 +113,11 @@ export class RoomComponent implements OnInit, OnDestroy {
this.messageSubscription = this.chatService.messageChanged
.subscribe((messages) => {
this.messages = messages
// console.log(messages);
this.countMessages=this.countMessages+1;
if(this.show)
{
this.countMessages=0
}
})
}

Expand Down Expand Up @@ -419,6 +424,7 @@ export class RoomComponent implements OnInit, OnDestroy {

chat() {
this.show = !this.show;
this.countMessages=0;
}
nochat()
{
Expand Down

0 comments on commit 0fefaa4

Please sign in to comment.