Skip to content

Commit 20ab08d

Browse files
committed
chore: minor fixes after code review
1 parent c2a6522 commit 20ab08d

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

meteor/server/api/deviceTriggers/triggersContext.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class MeteorTriggersCollectionWrapper<DBInterface extends { _id: ProtectedString
5050
selector: MongoQuery<DBInterface>,
5151
options?: FindOptions<DBInterface>
5252
): Promise<Array<DBInterface>> {
53+
// Note: the _computation is not used, since we are not using Tracker server-side
5354
return this.#collection.findFetchAsync(selector, options)
5455
}
5556

@@ -58,6 +59,7 @@ class MeteorTriggersCollectionWrapper<DBInterface extends { _id: ProtectedString
5859
selector: MongoQuery<DBInterface> | DBInterface['_id'],
5960
options?: FindOneOptions<DBInterface>
6061
): Promise<DBInterface | undefined> {
62+
// Note: the _computation is not used, since we are not using Tracker server-side
6163
return this.#collection.findOneAsync(selector, options)
6264
}
6365
}
@@ -97,6 +99,7 @@ export const MeteorTriggersContext: TriggersContext = {
9799
},
98100

99101
withComputation: async (_computation, func) => {
102+
// Note: the _computation is not used, since we are not using Tracker server-side
100103
return func()
101104
},
102105

packages/webui/src/client/lib/ReactMeteorData/ReactMeteorData.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,12 @@ export function useTracker<T, K extends undefined | T = undefined>(
374374
* This is an alternate implementation which supports promises in the autorun function, and will preserve the previous value until the promise resolves.
375375
*
376376
* @param {() => Promise<T>} autorun The autorun function to be run.
377-
* @param {React.DependencyList} [deps] A required list of dependenices to limit the tracker re-running. Can be left empty, if tracker
377+
* @param {React.DependencyList} [deps] A required list of dependencies to limit the tracker re-running. Can be left empty, if tracker
378378
* has no external dependencies and should only be rerun when it's invalidated.
379379
* @param {K} [initial] An optional, initial state of the tracker. If not provided, the tracker may return undefined.
380380
* @return {*} {(T | K)}
381381
*/
382-
export function useTrackerAsyncTest<T, K extends undefined | T = undefined>(
382+
export function useTrackerAsync<T, K extends undefined | T = undefined>(
383383
autorun: (computation: Tracker.Computation) => Promise<T>,
384384
deps: React.DependencyList,
385385
initial?: K

packages/webui/src/client/ui/Settings/components/triggeredActions/TriggeredActionEntry.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
} from '@sofie-automation/blueprints-integration'
1111
import classNames from 'classnames'
1212
import { DBBlueprintTrigger } from '@sofie-automation/meteor-lib/dist/collections/TriggeredActions'
13-
import { useTracker, useTrackerAsyncTest } from '../../../../lib/ReactMeteorData/ReactMeteorData'
13+
import { useTracker, useTrackerAsync } from '../../../../lib/ReactMeteorData/ReactMeteorData'
1414
import { ActionEditor } from './actionEditors/ActionEditor'
1515
import { OutputLayers, SourceLayers } from '@sofie-automation/corelib/dist/dataModel/ShowStyleBase'
1616
import { flatten, getRandomString } from '../../../../lib/tempLib'
@@ -183,7 +183,7 @@ export const TriggeredActionEntry: React.FC<IProps> = React.memo(function Trigge
183183
[triggeredAction?.actionsWithOverrides]
184184
)
185185

186-
const previewItems = useTrackerAsyncTest<IWrappedAdLib[], IWrappedAdLib[]>(
186+
const previewItems = useTrackerAsync<IWrappedAdLib[], IWrappedAdLib[]>(
187187
async (computation) => {
188188
try {
189189
if (!resolvedActions || !selected || !sourceLayers) return []

0 commit comments

Comments
 (0)