Explorar o código

Move if clause out of setTimeout

sbkwgh %!s(int64=8) %!d(string=hai) anos
pai
achega
ccf73a6166
Modificáronse 1 ficheiros con 4 adicións e 6 borrados
  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;