Merge branch 'master' into q-beta

This commit is contained in:
Mygod
2019-04-04 11:09:47 +08:00
11 changed files with 42 additions and 30 deletions

View File

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