From 36f52234a3c7cb3eb509a2ee9b63d0bb791dfe1a Mon Sep 17 00:00:00 2001 From: Daniele Verducci Date: Sat, 18 Jan 2025 08:56:12 +0100 Subject: [PATCH] Fixed bug loading always default logbook, indipendently from which one is selected --- .../java/it/danieleverducci/lunatracker/MainActivity.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/it/danieleverducci/lunatracker/MainActivity.kt b/app/src/main/java/it/danieleverducci/lunatracker/MainActivity.kt index 07ed707..5cd47be 100644 --- a/app/src/main/java/it/danieleverducci/lunatracker/MainActivity.kt +++ b/app/src/main/java/it/danieleverducci/lunatracker/MainActivity.kt @@ -56,7 +56,7 @@ class MainActivity : AppCompatActivity() { lateinit var handler: Handler var savingEvent = false val updateListRunnable: Runnable = Runnable { - loadLogbook() + loadLogbook(logbook.name) handler.postDelayed(updateListRunnable, 1000*60) } var logbookRepo: LogbookRepository? = null @@ -122,10 +122,10 @@ class MainActivity : AppCompatActivity() { showSettings() }) findViewById(R.id.button_no_connection_retry).setOnClickListener({ - loadLogbook() + loadLogbook(logbook.name) }) findViewById(R.id.button_sync).setOnClickListener({ - loadLogbook() + loadLogbook(logbook.name) }) } @@ -378,7 +378,7 @@ class MainActivity : AppCompatActivity() { loadLogbookList() // TODO: Does not reload logbooks buttons on top, why? } - fun loadLogbook(name: String = LogbookRepository.DEFAULT_LOGBOOK_NAME) { + fun loadLogbook(name: String) { if (savingEvent) return