Commit 517bb785 authored by fanxuehui's avatar fanxuehui

fix(错误的关闭监听):

parent 20ba8952
......@@ -16,5 +16,4 @@
### 发布
- npm run build
- 安全性考虑,需要手动上传`[hash].worker.js`文件到苍穹,路径为`/tuia/rip/`
- npm publish
......@@ -57,11 +57,12 @@ class Monitor {
window.addEventListener("hashchange", () => {
// 忽略hash后的query
let hash = getPureHash(location.hash);
if (hash === preHash) return;
if (hash === preHash) return console.log('hash query 无变化,no reset');;
preHash = hash;
//防抖,防止无效的频繁触发
clearTimeout(timer);
timer = setTimeout(() => {
console.log('hashchange reset');
this.reset({ path: location.hash });
}, 1000);
});
......@@ -82,7 +83,6 @@ class Monitor {
* @param {*} event
*/
reset(event) {
this.resetRrwebHandler();
console.log("重置数据");
this.tracksWorker.postMessage({ type: "reset", payload: event });
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment