Skip to content

Commit

Permalink
fix: Deeper equality check
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaudlr committed Oct 6, 2023
1 parent edaa713 commit 4dc3938
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/live-status-gateway/src/collections/adLibActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DBPartInstance } from '@sofie-automation/corelib/dist/dataModel/PartIns
import { unprotectString } from '@sofie-automation/shared-lib/dist/lib/protectedString'
import { PartInstanceName } from './partInstances'
import { CollectionName } from '@sofie-automation/corelib/dist/dataModel/Collections'
import _ = require('underscore')

export class AdLibActionsHandler
extends CollectionBase<AdLibAction[]>
Expand Down Expand Up @@ -42,7 +43,7 @@ export class AdLibActionsHandler
await new Promise(process.nextTick.bind(this))
if (!this._collectionName) return
if (!this._publicationName) return
if (prevRundownId !== this._curRundownId || prevCurPartInstance !== this._curPartInstance) {
if (prevRundownId !== this._curRundownId || !_.isEqual(prevCurPartInstance, this._curPartInstance)) {
if (this._subscriptionId) this._coreHandler.unsubscribe(this._subscriptionId)
if (this._dbObserver) this._dbObserver.stop()
if (this._curRundownId && this._curPartInstance) {
Expand Down
3 changes: 2 additions & 1 deletion packages/live-status-gateway/src/collections/adLibs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DBPartInstance } from '@sofie-automation/corelib/dist/dataModel/PartIns
import { unprotectString } from '@sofie-automation/shared-lib/dist/lib/protectedString'
import { PartInstanceName } from './partInstances'
import { CollectionName } from '@sofie-automation/corelib/dist/dataModel/Collections'
import _ = require('underscore')

export class AdLibsHandler
extends CollectionBase<AdLibPiece[]>
Expand Down Expand Up @@ -42,7 +43,7 @@ export class AdLibsHandler
await new Promise(process.nextTick.bind(this))
if (!this._collectionName) return
if (!this._publicationName) return
if (!(prevRundownId === this._curRundownId && prevCurPartInstance === this._curPartInstance)) {
if (prevRundownId !== this._curRundownId || !_.isEqual(prevCurPartInstance, this._curPartInstance)) {
if (this._subscriptionId) this._coreHandler.unsubscribe(this._subscriptionId)
if (this._dbObserver) this._dbObserver.stop()
if (this._curRundownId && this._curPartInstance) {
Expand Down

0 comments on commit 4dc3938

Please sign in to comment.