Skip to content

Commit

Permalink
use directly
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Nov 13, 2024
1 parent 84f2392 commit 11f2c81
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/extensions/replay/sessionrecording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
} from './sessionrecording-utils'
import { PostHog } from '../../posthog-core'
import {
CaptureResult,
DecideResponse,
FlagVariant,
NetworkRecordOptions,
Expand Down Expand Up @@ -1287,11 +1288,11 @@ export class SessionRecording {
return
}

this._removeEventTriggerCaptureHook = this.instance._addCaptureHook((eventName) => {
this._removeEventTriggerCaptureHook = this.instance.on('eventCaptured', (event: CaptureResult) => {
// If anything could go wrong here it has the potential to block the main loop,
// so we catch all errors.
try {
if (this._eventTriggers.includes(eventName)) {
if (this._eventTriggers.includes(event.event)) {
this._activateTrigger('event')
}
} catch (e) {
Expand Down

0 comments on commit 11f2c81

Please sign in to comment.