This commit is contained in:
Mygod
2019-03-22 12:06:55 +08:00
committed by GitHub
parent e81e66b84f
commit f83f81120b

View File

@@ -67,11 +67,10 @@ class ClientsFragment : Fragment(), MainScope by MainScope.Supervisor() {
override fun onClick(dialog: DialogInterface?, which: Int) { override fun onClick(dialog: DialogInterface?, which: Int) {
when (which) { when (which) {
DialogInterface.BUTTON_POSITIVE -> { DialogInterface.BUTTON_POSITIVE -> {
val newNickname = this@NicknameDialogFragment.dialog!!.findViewById<EditText>(android.R.id.edit).text
MacLookup.abort(arg.mac) MacLookup.abort(arg.mac)
GlobalScope.launch(Dispatchers.Unconfined) { GlobalScope.launch(Dispatchers.Unconfined) {
AppDatabase.instance.clientRecordDao.upsert(arg.mac) { AppDatabase.instance.clientRecordDao.upsert(arg.mac) { nickname = newNickname }
nickname = this@NicknameDialogFragment.dialog!!.findViewById<EditText>(android.R.id.edit).text
}
} }
} }
DialogInterface.BUTTON_NEUTRAL -> MacLookup.perform(arg.mac, true) DialogInterface.BUTTON_NEUTRAL -> MacLookup.perform(arg.mac, true)