gemercheung 2 năm trước cách đây
mục cha
commit
126a382f35
2 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 1 1
      package.json
  2. 4 1
      src/room/actions/actions.service.ts

+ 1 - 1
package.json

@@ -12,7 +12,7 @@
     "start:dev": "nest start --watch",
     "start:debug": "nest start --debug --watch",
     "start:prod": "node dist/main",
-    "pm2:prod": "cross-env NODE_ENV=production pm2 start -- ecosystem.config.js",
+    "pm2:prod": "npm run build && cross-env NODE_ENV=production pm2 start -- ecosystem.config.js",
     "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
     "test": "jest",
     "test:watch": "jest --watch",

+ 4 - 1
src/room/actions/actions.service.ts

@@ -12,7 +12,7 @@ export class ActionsService {
     private roomService: RoomService,
     @Inject(forwardRef(() => UsersService))
     private userService: UsersService,
-  ) {}
+  ) { }
 
   async handleAllAction(socket: Socket, data: ActionsParams): Promise<void> {
     const isSocketLeader = () => {
@@ -30,10 +30,13 @@ export class ActionsService {
       case 'users-muted':
         const mutedParams = data as any as MutedStateType;
         isSocketLeader() && (await this.handleMutedState(mutedParams));
+        await this.roomService.handleRoomStatusAction(socket);
         break;
       case 'users-words':
         const typingParams = data as any as TypingStateType;
         isSocketLeader() && (await this.handleTypingState(typingParams));
+        this.roomService.handleRoomStatusAction(socket);
+        await this.roomService.handleRoomStatusAction(socket);
         break;
       case 'users-kicked':
         const kickParams = data as any as KickStateType;