Rely on shared FoundContent for empty state; simplify MainActivity

This commit is contained in:
2025-09-18 21:17:51 +02:00
parent ee440e3ffb
commit f0d9f8ef2e

View File

@@ -764,14 +764,9 @@ private fun KlottrApp(
} }
} }
} }
val my = LastLocationStore.lastKnownLocation // Ny: Flytta upp så FoundContent alltid ritas
val _tick = locationTick // Ny: Behåll trigger
if (foundList.isEmpty()) {
Text("Inga fynd ännu.")
} else {
val my = LastLocationStore.lastKnownLocation
val _tick = locationTick
Box(modifier = Modifier.fillMaxSize()) {
FoundContent( FoundContent(
entries = foundList, entries = foundList,
currentLat = my?.latitude, currentLat = my?.latitude,
@@ -807,15 +802,9 @@ private fun KlottrApp(
label = action.label label = action.label
) )
} }
is FoundOpenAction.Wiki -> { is FoundOpenAction.Wiki -> { openWiki = OpenWiki(action.pageId, action.lat, action.lon) }
openWiki = OpenWiki(action.pageId, action.lat, action.lon) is FoundOpenAction.Fornsok -> { openFornsok = OpenFornsok(action.item) }
} is FoundOpenAction.DigitaltMuseum -> { openDm = action.item }
is FoundOpenAction.Fornsok -> {
openFornsok = OpenFornsok(action.item)
}
is FoundOpenAction.DigitaltMuseum -> {
openDm = action.item
}
FoundOpenAction.None -> Unit FoundOpenAction.None -> Unit
} }
} }
@@ -827,8 +816,6 @@ private fun KlottrApp(
color = MaterialTheme.colorScheme.onSurface color = MaterialTheme.colorScheme.onSurface
) )
) )
}
}
}, },
footerContent = { footerContent = {
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) { Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {