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