关联用户列表优化

This commit is contained in:
2026-05-25 17:08:45 +08:00
parent 95e2d9a3bf
commit fa3ac69752

View File

@@ -181,16 +181,19 @@ class LinkedUserActivity : AppCompatActivity() {
binding.swipeRefresh.isRefreshing = true
lifecycleScope.launch {
try {
val deviceId = DeviceIdEvent.getDeviceId()
if (deviceId.isNullOrEmpty()) {
Toast.makeText(this@LinkedUserActivity, "设备 ID 为空", Toast.LENGTH_SHORT).show()
withContext(Dispatchers.Main) {
binding.swipeRefresh.isRefreshing = false
var deviceId: String? = null
if (mode == MODE_SETTINGS) {
deviceId = DeviceIdEvent.getDeviceId()
if (deviceId.isNullOrEmpty()) {
Toast.makeText(this@LinkedUserActivity, "设备 ID 为空", Toast.LENGTH_SHORT).show()
withContext(Dispatchers.Main) {
binding.swipeRefresh.isRefreshing = false
}
return@launch
}
return@launch
}
val response = if (mode == MODE_SETTINGS) {
RetrofitNetwork.getNetworkService().getDeviceUserList(deviceId)
RetrofitNetwork.getNetworkService().getDeviceUserList(deviceId!!)
} else {
RetrofitNetwork.getNetworkService().getFamilyMembers()
}