File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -77,19 +77,23 @@ watchEffect(async () => {
77
77
langLoaded .value = true
78
78
})
79
79
80
- watchEffect (async () => {
80
+ watchEffect (async (onInvalidate ) => {
81
81
if (! langLoaded .value || ! yaml .value ) {
82
82
return
83
83
}
84
+ let invalidated = false
84
85
// before async
85
86
const [src, json] = [source .value , buildRules ()]
87
+ onInvalidate (() => invalidated = true )
86
88
try {
87
89
const [matches, fixed] = await doFind (src , json )
90
+ if (invalidated ) { return }
88
91
rewrittenCode .value = fixed
89
92
matchedHighlights .value = matches
90
93
matchedEnvs .value = matches .map (m => m .env )
91
94
ruleErrors .value = null
92
95
} catch (e ) {
96
+ if (invalidated ) { return }
93
97
console .error (e )
94
98
ruleErrors .value = e .toString ()
95
99
matchedHighlights .value = []
You can’t perform that action at this time.
0 commit comments