Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Oct 24, 2023
1 parent 051347b commit d28803d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/__tests__/extensions/replay/sessionrecording.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -613,27 +613,27 @@ describe('SessionRecording', () => {

sessionRecording.startRecordingIfEnabled()

expect(sessionRecording['_captureStarted']).toEqual(true)
expect(sessionRecording.started).toEqual(true)
expect(sessionRecording['stopRrweb']).not.toEqual(undefined)

sessionRecording.stopRecording()

expect(sessionRecording['stopRrweb']).toEqual(undefined)
expect(sessionRecording['_captureStarted']).toEqual(false)
expect(sessionRecording.started).toEqual(false)
})

it('session recording can be turned on after being turned off', () => {
expect(sessionRecording['stopRrweb']).toEqual(undefined)

sessionRecording.startRecordingIfEnabled()

expect(sessionRecording['_captureStarted']).toEqual(true)
expect(sessionRecording.started).toEqual(true)
expect(sessionRecording['stopRrweb']).not.toEqual(undefined)

sessionRecording.stopRecording()

expect(sessionRecording['stopRrweb']).toEqual(undefined)
expect(sessionRecording['_captureStarted']).toEqual(false)
expect(sessionRecording.started).toEqual(false)
})

describe('console logs', () => {
Expand Down
5 changes: 5 additions & 0 deletions src/extensions/replay/sessionrecording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ export class SessionRecording {
private _sampleRate: number | null = null
private _minimumDuration: number | null = null

public get started(): boolean {
// TODO could we use status instead of _captureStarted?
return this._captureStarted
}

private get sessionManager() {
if (!this.instance.sessionManager) {
logger.error('Session recording started without valid sessionManager')
Expand Down

0 comments on commit d28803d

Please sign in to comment.