big fix: 线程切换问题

This commit is contained in:
level 2025-07-15 15:49:54 +08:00
parent 654f28c2cd
commit 0932839b27
1 changed files with 8 additions and 6 deletions

View File

@ -220,7 +220,7 @@ open class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dis
return
}
showLoading(resources.getString(R.string.Starting), requireContext())
startClash()
startClash(true)
getDelayData()
}
}
@ -230,9 +230,11 @@ open class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dis
fun stopClash() {
context?.stopClashService()
}
private fun startClash() {
private fun startClash(isStart:Boolean) {
launch {
delay(2000)
if(isStart){
delay(2000)
}
NewMainActivity.profileBinder?.let { pm ->
val active = pm.queryActive()
if (active == null) {
@ -400,12 +402,12 @@ open class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dis
if (clashRunning) {
Log.d("clashRunning $clashRunning")
} else {
startClash()
startClash(false)
}
checkGlo()
}?.run {
if (isRunning == true && !clashRunning) {
startClash()
startClash(false)
}
}
}
@ -419,7 +421,7 @@ open class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dis
if (clashRunning) {
Log.d("clashRunning $clashRunning")
} else {
startClash()
startClash(false)
}
} else {
if (::rxDialogShapeLoading.isInitialized || rxDialogShapeLoading.isShowing) {