소스 검색

Move if clause out of setTimeout

sbkwgh 8 년 전
부모
커밋
ccf73a6166
1개의 변경된 파일4개의 추가작업 그리고 6개의 파일을 삭제
  1. 4 6
      src/components/routes/Thread.vue

+ 4 - 6
src/components/routes/Thread.vue

@@ -142,12 +142,10 @@
 							window.scrollTo(0, postTop - header - 32)
 
 							this.highlightedPostIndex = i
-
-							setTimeout(() => {
-								if(this.highlightedPostIndex === i) {
-									this.highlightedPostIndex = null
-								}
-							}, 3000)
+							
+							if(this.highlightedPostIndex === i) {
+								setTimeout(() => this.highlightedPostIndex = null, 3000)
+							}
 						})
 
 						break;