app(nearby): move markNewFinds to fetch phase; simplify NearbyDialog to render built entries; drop wiki/klotter/radius params from dialog and call site

This commit is contained in:
2025-09-16 00:26:56 +02:00
parent c54833dfe2
commit 2ff8349c1d

View File

@@ -675,6 +675,14 @@ private fun KlottrApp(
nearbyEntries = bundle.entries nearbyEntries = bundle.entries
nearbyDm = bundle.dm nearbyDm = bundle.dm
nearbyFornsok = bundle.forn nearbyFornsok = bundle.forn
// [NY] Markera nya fynd direkt här (inte i dialogen)
val nowMillis = System.currentTimeMillis() // [NY]
app.klottr.nearby.markNewFinds( // [NY] (fullt kvalificerat anrop, ingen extra import)
ctx = ctx, // [NY]
entries = nearbyEntries, // [NY]
nowMillis = nowMillis, // [NY]
onMarked = { refreshFound() } // [NY] trigga samma uppdatering som tidigare
)
// [VALFRITT] Logg – nu summerar vi entries + per-lager // [VALFRITT] Logg – nu summerar vi entries + per-lager
app.klottr.util.AppLog.d { app.klottr.util.AppLog.d {
@@ -1341,15 +1349,6 @@ private fun NearbyDialog(
entries entries
} else emptyList() } else emptyList()
if (hasLocation && !loading && error == null) {
app.klottr.nearby.markNewFinds(
ctx = ctx,
entries = entries,
nowMillis = now,
onMarked = { onMarkedFound() }
)
}
// Dialogens innehåll i delat skal med rimlig höjd (max ~80% av skärmen) // Dialogens innehåll i delat skal med rimlig höjd (max ~80% av skärmen)
val cfg = LocalConfiguration.current val cfg = LocalConfiguration.current
val maxDialogHeight = (cfg.screenHeightDp * 0.8f).dp val maxDialogHeight = (cfg.screenHeightDp * 0.8f).dp