()
| 307 | */ |
| 308 | @errorCapture<RoomService>() |
| 309 | async watch() { |
| 310 | const state = this.store.getState(); |
| 311 | const shareId = state.pageParams.shareId; |
| 312 | const embedId = state.pageParams.embedId; |
| 313 | const watchResponse = await this.io.watch<IWatchResponse, any>(this.roomId, shareId, embedId).catch((e) => { |
| 314 | throw new EnhanceError(e); |
| 315 | }); |
| 316 | |
| 317 | this.setConnected(true); |
| 318 | if (!watchResponse) { |
| 319 | return; |
| 320 | } |
| 321 | const { resourceRevisions, collaborators } = watchResponse.data!; |
| 322 | // console.log('resourceRevisions:', resourceRevisions); |
| 323 | const collaEngine = this.collaEngineMap.get(this.roomId); |
| 324 | if (!collaEngine) { |
| 325 | return; |
| 326 | } |
| 327 | await this.checkVersion(resourceRevisions); |
| 328 | const resourceType = collaEngine.resourceType; |
| 329 | this.store.dispatch(roomInfoSync(this.roomId, resourceType, collaborators || [])); |
| 330 | this.store.dispatch(setResourceConnect(this.roomId, resourceType)); |
| 331 | this.loadFieldPermissionMap(); |
| 332 | this.bindSocketMessage(); |
| 333 | this.setSendingWatcher(); |
| 334 | } |
| 335 | |
| 336 | /** |
| 337 | * Switching resources or reconnecting after disconnection requires the column permissions of all data tables in the room |
no test coverage detected