fix: preserve mobile auth form while editing

This commit is contained in:
Курнат Андрей
2026-07-14 23:25:43 +03:00
parent 4c347ed425
commit 1c7701c38e
2 changed files with 7 additions and 3 deletions
+2 -2
View File
@@ -10,8 +10,8 @@ android {
applicationId = "xyz.kusoft.tradebotmonitor"
minSdk = 26
targetSdk = 37
versionCode = 22
versionName = "0.5.0"
versionCode = 23
versionName = "0.5.1"
}
}
@@ -203,7 +203,7 @@ class MainActivity : Activity() {
private fun shouldRenderAfterRefresh(silent: Boolean, hadSnapshot: Boolean, hadError: Boolean, trainingChanged: Boolean): Boolean {
val focused = contentHost.findFocus()
if (activeTab == "settings" && focused is EditText) {
if (focused is EditText) {
return false
}
if (!silent) {
@@ -502,6 +502,8 @@ class MainActivity : Activity() {
"Сохранить" to {
prefs.apiBaseUrl = apiInput.text.toString()
prefs.commandToken = tokenInput.text.toString()
apiInput.clearFocus()
tokenInput.clearFocus()
toast("Подключение сохранено")
refreshData(silent = false)
},
@@ -1287,6 +1289,8 @@ class MainActivity : Activity() {
"Подключиться" to {
prefs.apiBaseUrl = apiInput.text.toString()
prefs.commandToken = tokenInput.text.toString()
apiInput.clearFocus()
tokenInput.clearFocus()
toast("Доступ сохранен, проверяю API")
refreshData(silent = false)
},