diff --git a/src/angularjs/src/app/components/chat-view/chat-view.component.html b/src/angularjs/src/app/components/chat-view/chat-view.component.html index f485e559..2963721f 100755 --- a/src/angularjs/src/app/components/chat-view/chat-view.component.html +++ b/src/angularjs/src/app/components/chat-view/chat-view.component.html @@ -1,27 +1,30 @@
    -
  1. - {{getCurrentMessage(i).updateAt | date: 'dd/MM/YYYY'}} -
    -
    - -
    -
    - - - {{content.content.replace(' ', ' ')}} - -
    -
    - - +
    +
  2. +
    + {{getCurrentMessage(i).updateAt | date: 'dd/MM/YYYY'}} +
    + +
    +
    + + + {{content.content.replace(' ', ' ')}} + +
    +
    + + +
    + {{getCurrentMessage(i).updateAt | date: 'HH:mm'}}
    - {{getCurrentMessage(i).updateAt | date: 'HH:mm'}} - -
  3. + +
{{messageLength}}/120 diff --git a/src/angularjs/src/app/components/chat-view/chat-view.component.ts b/src/angularjs/src/app/components/chat-view/chat-view.component.ts index 97e96018..99a6562d 100755 --- a/src/angularjs/src/app/components/chat-view/chat-view.component.ts +++ b/src/angularjs/src/app/components/chat-view/chat-view.component.ts @@ -6,6 +6,7 @@ import { MessageContentI, MessageContentType, MessageI } from 'src/app/interface import { UserI } from 'src/app/interfaces/user/user.interface'; import { UserService } from 'src/app/services/user.service'; import { ChatRoomService } from 'src/app/services/websocket/chat/chatroom.service'; +import { FriendService } from 'src/app/services/websocket/friend/service'; @Component({ selector: 'app-chat-view', @@ -27,6 +28,7 @@ export class ChatViewComponent { private formBuilder: FormBuilder, private chatRoomService: ChatRoomService, public userService: UserService, + public friendService: FriendService, public router: Router, ) {} diff --git a/src/angularjs/src/app/pages/home-dashboard/home-dashboard.component.html b/src/angularjs/src/app/pages/home-dashboard/home-dashboard.component.html index 64ca2ed7..9040917f 100755 --- a/src/angularjs/src/app/pages/home-dashboard/home-dashboard.component.html +++ b/src/angularjs/src/app/pages/home-dashboard/home-dashboard.component.html @@ -5,6 +5,9 @@

Dashboard

Leaderboard + diff --git a/src/angularjs/src/app/pages/home-dashboard/home-dashboard.component.ts b/src/angularjs/src/app/pages/home-dashboard/home-dashboard.component.ts index ce935a3a..58753076 100755 --- a/src/angularjs/src/app/pages/home-dashboard/home-dashboard.component.ts +++ b/src/angularjs/src/app/pages/home-dashboard/home-dashboard.component.ts @@ -98,4 +98,20 @@ export class HomeDashboardComponent { .subscribe((res) => { this.onlineusers = res[0]; }); } + async refLeaderboard() { + const leadreq = await this.back.req("GET", "/leaderboard"); + + this.breakpointObserver.observe(Breakpoints.Handset).pipe( + map(({ matches }) => { + if (matches) { + return [ + { cols: 3, rows: 1, content: leadreq } + ]; + } + return [ + { cols: 2, rows: 2, content: leadreq } + ]; + })) + .subscribe((res) => { this.leaderboard = res[0]; }); + } } diff --git a/src/angularjs/src/app/services/websocket/chat/chatroom.service.ts b/src/angularjs/src/app/services/websocket/chat/chatroom.service.ts index ee3df88f..b733bb50 100755 --- a/src/angularjs/src/app/services/websocket/chat/chatroom.service.ts +++ b/src/angularjs/src/app/services/websocket/chat/chatroom.service.ts @@ -114,6 +114,8 @@ export class ChatRoomService { { const admin = this.getAdmin(room); + if (this.isOwner(room, user_id)) + return (true); if (!admin.length || admin.length === 0) return false; for (var i = 0; i < admin.length; i++) if (admin[i].id === user_id) diff --git a/src/angularjs/src/favicon.ico b/src/angularjs/src/favicon.ico old mode 100644 new mode 100755