@hmcts/media-viewer 3.1.2 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2166,7 +2166,9 @@ class IcpUpdateService {
2166
2166
  }
2167
2167
  removeParticipant(participantId) {
2168
2168
  this.socket.emit(IcpEvents.REMOVE_PARTICIPANT, {
2169
- participantId: participantId, caseId: this.session.caseId
2169
+ participantId: participantId,
2170
+ caseId: this.session.caseId,
2171
+ documentId: this.session.documentId
2170
2172
  });
2171
2173
  }
2172
2174
  participantListUpdated() {
@@ -2174,14 +2176,20 @@ class IcpUpdateService {
2174
2176
  }
2175
2177
  updatePresenter(presenter) {
2176
2178
  this.socket.emit(IcpEvents.UPDATE_PRESENTER, {
2177
- ...this.session, presenterId: presenter.id, presenterName: presenter.username
2179
+ ...this.session,
2180
+ presenterId: presenter.id,
2181
+ presenterName: presenter.username
2178
2182
  });
2179
2183
  }
2180
2184
  presenterUpdated() {
2181
2185
  return this.socket.listen(IcpEvents.PRESENTER_UPDATED);
2182
2186
  }
2183
2187
  updateScreen(screen) {
2184
- const update = { body: screen, caseId: this.session.caseId };
2188
+ const update = {
2189
+ body: screen,
2190
+ caseId: this.session.caseId,
2191
+ documentId: this.session.documentId
2192
+ };
2185
2193
  this.socket.emit(IcpEvents.UPDATE_SCREEN, update);
2186
2194
  }
2187
2195
  screenUpdated() {
@@ -2303,8 +2311,9 @@ class IcpService {
2303
2311
  this.subscription = this.store.pipe(select(getCaseId), filter(value => !!value)).subscribe(caseId => {
2304
2312
  this.caseId = caseId;
2305
2313
  });
2314
+ this.subscription.add(this.store.pipe(select(getDocumentId)).subscribe(docId => this.documentId = docId));
2306
2315
  this.subscription.add(this.toolbarEvents.icp.sessionLaunch.subscribe(() => {
2307
- if (this.caseId) {
2316
+ if (this.caseId && this.documentId) {
2308
2317
  this.launchSession();
2309
2318
  }
2310
2319
  }));
@@ -2314,7 +2323,7 @@ class IcpService {
2314
2323
  this.subscription.unsubscribe();
2315
2324
  }
2316
2325
  launchSession() {
2317
- this.store.dispatch(new LoadIcpSession(this.caseId));
2326
+ this.store.dispatch(new LoadIcpSession({ caseId: this.caseId, documentId: this.documentId }));
2318
2327
  this.subscription.add(this.store.pipe(select(getIcpSession), filter(value => !!value && Object.keys(value).length > 1), take(1)).subscribe(() => { this.setUpSessionSubscriptions(); }));
2319
2328
  }
2320
2329
  setUpSessionSubscriptions() {
@@ -6850,9 +6859,9 @@ class IcpSessionApiService {
6850
6859
  this.httpClient = httpClient;
6851
6860
  this.ICP_SESSION_API = '/icp/sessions';
6852
6861
  }
6853
- loadSession(caseId) {
6862
+ loadSession(payload) {
6854
6863
  return this.httpClient
6855
- .get(`${this.ICP_SESSION_API}/${caseId}`, { observe: 'response', withCredentials: true })
6864
+ .get(`${this.ICP_SESSION_API}/${payload.caseId}/${payload.documentId}`, { observe: 'response', withCredentials: true })
6856
6865
  .pipe(map(response => response.body));
6857
6866
  }
6858
6867
  }
@@ -7122,7 +7131,7 @@ class IcpEffects {
7122
7131
  this.actions$ = actions$;
7123
7132
  this.icpApiService = icpApiService;
7124
7133
  this.icpUpdateService = icpUpdateService;
7125
- this.loadIcpSession$ = createEffect(() => this.actions$.pipe(ofType(LOAD_ICP_SESSION), map((action) => action.payload), exhaustMap((caseId) => this.icpApiService.loadSession(caseId)
7134
+ this.loadIcpSession$ = createEffect(() => this.actions$.pipe(ofType(LOAD_ICP_SESSION), map((action) => action.payload), exhaustMap((payload) => this.icpApiService.loadSession(payload)
7126
7135
  .pipe(map(res => new JoinIcpSocketSession(res)), catchError(error => of(new LoadIcpSessionFailure(error)))))));
7127
7136
  this.joinIcpSocketSession$ = createEffect(() => this.actions$.pipe(ofType(JOIN_ICP_SOCKET_SESSION), map((action) => action.payload), switchMap((res) => this.icpUpdateService.joinSession(res.username, res.session)
7128
7137
  .pipe(map(participants => new IcpSocketSessionJoined({ session: res.session, participantInfo: participants }))))));