缓存上次加入的群组
This commit is contained in:
parent
923c88c595
commit
b3c7e243b5
|
|
@ -76,26 +76,26 @@ class MainActivity : AppCompatActivity() {
|
|||
|
||||
@JvmStatic
|
||||
fun checkAndAutoJumpToLastGroup() {
|
||||
synchronized(this) {
|
||||
if (hasFirstGroupEntered && hasPageFinished && !hasAutoJumped) {
|
||||
hasAutoJumped = true
|
||||
instance?.let { ctx ->
|
||||
val lastGroupId = AppConfig.getLastGroupId(ctx)
|
||||
if (lastGroupId.isNotEmpty()) {
|
||||
Timber.tag("PTT").d("Both conditions met. Auto-jumping to last joined group: %s after 2s delay", lastGroupId)
|
||||
ctx.runOnUiThread {
|
||||
android.os.Handler(android.os.Looper.getMainLooper()).postDelayed({
|
||||
instance?.pttInterface?.pttJumpGroup(lastGroupId)
|
||||
}, 1000)
|
||||
}
|
||||
} else {
|
||||
Timber.tag("PTT").d("Both conditions met but lastGroupId is empty, skip auto-jump")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Timber.tag("PTT").d("Check auto jump: hasFirstGroupEntered=$hasFirstGroupEntered, hasPageFinished=$hasPageFinished, hasAutoJumped=$hasAutoJumped")
|
||||
}
|
||||
}
|
||||
// synchronized(this) {
|
||||
// if (hasFirstGroupEntered && hasPageFinished && !hasAutoJumped) {
|
||||
// hasAutoJumped = true
|
||||
// instance?.let { ctx ->
|
||||
// val lastGroupId = AppConfig.getLastGroupId(ctx)
|
||||
// if (lastGroupId.isNotEmpty()) {
|
||||
// Timber.tag("PTT").d("Both conditions met. Auto-jumping to last joined group: %s after 2s delay", lastGroupId)
|
||||
// ctx.runOnUiThread {
|
||||
// android.os.Handler(android.os.Looper.getMainLooper()).postDelayed({
|
||||
// instance?.pttInterface?.pttJumpGroup(lastGroupId)
|
||||
// }, 1000)
|
||||
// }
|
||||
// } else {
|
||||
// Timber.tag("PTT").d("Both conditions met but lastGroupId is empty, skip auto-jump")
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// Timber.tag("PTT").d("Check auto jump: hasFirstGroupEntered=$hasFirstGroupEntered, hasPageFinished=$hasPageFinished, hasAutoJumped=$hasAutoJumped")
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
|
|
|
|||
Loading…
Reference in New Issue