File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed
Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ function handleViewerKeyDown(event) {// * 查看器内部 检查是否按下了
151151let theCycleUpdateInterval
152152function turnOnCycleUpdate() {
153153 console .log (' Turn on cycleUpdate' );
154- theCycleUpdateInterval = window . setInterval (handleLoadMore , 500 );
154+ theCycleUpdateInterval = setInterval (handleLoadMore , 500 );
155155}
156156
157157function tEventListening() { // * 一些乱七八糟的事件的监听
@@ -175,18 +175,12 @@ function tEventListening() { // * 一些乱七八糟的事件的监听
175175 }
176176 }
177177 });
178- setStore .$subscribe ((mutation : any , state ) => {
179- // console.log(mutation, state)
180- // 监听 章节正则表达式变化,之后重绘书籍
181- if (mutation .events .key == ' cycleUpdate' ) {
182- // console.log(state.cycleUpdate)
183- if (state .cycleUpdate )
184- turnOnCycleUpdate ()
185- else
186- window .clearInterval (theCycleUpdateInterval );
187- }
178+ watch (() => setStore .cycleUpdate , (newValue , oldValue ) => {
179+ if (newValue )
180+ turnOnCycleUpdate ()
181+ else
182+ clearInterval (theCycleUpdateInterval );
188183 })
189-
190184}
191185
192186// 首次加载
You can’t perform that action at this time.
0 commit comments