Skip to content

Commit

Permalink
Ensure app bar title isn't empty
Browse files Browse the repository at this point in the history
Signed-off-by: mueller-ma <mueller-ma@users.noreply.github.com>
  • Loading branch information
mueller-ma committed Jul 11, 2024
1 parent cc6b072 commit 87e2781
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mobile/src/main/java/org/openhab/habdroid/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ import org.openhab.habdroid.util.isDebugModeEnabled
import org.openhab.habdroid.util.isEventListenerEnabled
import org.openhab.habdroid.util.isScreenTimerDisabled
import org.openhab.habdroid.util.openInAppStore
import org.openhab.habdroid.util.orDefaultIfEmpty
import org.openhab.habdroid.util.parcelable
import org.openhab.habdroid.util.putActiveServerId
import org.openhab.habdroid.util.resolveThemedColor
Expand Down Expand Up @@ -1313,7 +1314,7 @@ class MainActivity : AbstractBaseActivity(), ConnectionFactory.UpdateListener {
fun updateTitle() {
val title = controller.currentTitle
val activeServerName = ServerConfiguration.load(prefs, getSecretPrefs(), prefs.getActiveServerId())?.name
setTitle(title ?: activeServerName ?: getString(R.string.app_name))
setTitle(title.orDefaultIfEmpty(activeServerName.orEmpty()).orDefaultIfEmpty(getString(R.string.app_name)))
drawerToggle.isDrawerIndicatorEnabled = !controller.canGoBack()
}

Expand Down

0 comments on commit 87e2781

Please sign in to comment.