@hmcts/ccd-case-ui-toolkit 7.3.0-exui-2906-activity-tracker-4 → 7.3.0-exui-2906-activity-tracker-5

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.
@@ -2226,17 +2226,22 @@ class ActivitySocketService {
2226
2226
  this.socket.emit('watch', { caseIds });
2227
2227
  }
2228
2228
  viewCase(caseId, isViewing) {
2229
- if (isViewing) {
2229
+ // only emit if viewing is true and socket is connected
2230
+ if (isViewing && this.socket && this.connected.value) {
2231
+ console.log('viewCase emit');
2230
2232
  this.socket.emit('view', { caseId });
2231
2233
  }
2232
2234
  }
2233
2235
  stopCase(caseId, isStopping) {
2236
+ // only emit if stopping is true
2234
2237
  if (isStopping) {
2235
2238
  this.socket.emit('stop', { caseId });
2236
2239
  }
2237
2240
  }
2238
2241
  editCase(caseId, isEditing) {
2239
- if (isEditing) {
2242
+ // only emit if editing is true and socket is connected
2243
+ if (isEditing && this.socket && this.connected.value) {
2244
+ console.log('editCase emit');
2240
2245
  this.socket.emit('edit', { caseId });
2241
2246
  }
2242
2247
  }