From 1f08ee5f1d2acdc342d8bfe2c58504a8f6a6559c Mon Sep 17 00:00:00 2001 From: wangfukang Date: Thu, 18 Aug 2022 21:14:19 +0800 Subject: [PATCH] fix: reset fns when when stopping record --- packages/rrweb/src/record/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/rrweb/src/record/index.ts b/packages/rrweb/src/record/index.ts index 756c21c56b..a639975376 100644 --- a/packages/rrweb/src/record/index.ts +++ b/packages/rrweb/src/record/index.ts @@ -518,6 +518,9 @@ function record( } 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