Skip to content

Commit

Permalink
fix: reset fns when when stopping record (#962)
Browse files Browse the repository at this point in the history
Co-authored-by: wangfukang <[email protected]>
  • Loading branch information
wfk007 and wfk007 authored Sep 17, 2022
1 parent ce6019d commit 6007266
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/rrweb/src/record/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,9 @@ function record<T = eventWithTime>(
}
return () => {
handlers.forEach((h) => h());
// reset init fns when stopping record
(wrappedEmit as unknown) = undefined;
(takeFullSnapshot as unknown) = undefined;
};
} catch (error) {
// TODO: handle internal error
Expand Down

0 comments on commit 6007266

Please sign in to comment.