Skip to content

Commit d6beb7d

Browse files
committed
fix: enableMatch not working (#915)
1 parent df67a3d commit d6beb7d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/src/main/kotlin/li/songe/gkd/service/A11yService.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ private fun A11yService.useMatchRule() {
186186
delayRule: ResolvedRule? = null,
187187
): Job = scope.launchTry(A11yService.queryThread) launchQuery@{
188188
queryTaskJob = coroutineContext[Job]
189+
if (!storeFlow.value.enableMatch) return@launchQuery
189190
fun checkFutureJob() {
190191
val t = System.currentTimeMillis()
191192
if (t - lastTriggerTime < 3000L || t - appChangeTime < 5000L) {
@@ -280,6 +281,8 @@ private fun A11yService.useMatchRule() {
280281
}
281282
}
282283
for (rule in activityRule.priorityRules) { // 规则数量有可能过多导致耗时过长
284+
// https://github.com/gkd-kit/gkd/issues/915
285+
if (activityRule !== getAndUpdateCurrentRules()) break
283286
if (delayRule != null && delayRule !== rule) continue
284287
val statusCode = rule.status
285288
if (statusCode == RuleStatus.Status3 && rule.matchDelayJob == null) {

0 commit comments

Comments
 (0)