Fix START button being disabled before permissions are granted
The button was gated on `granted || running`, but the only thing that triggers the permission request is tapping the button — catch-22 that left first-time users with no way to grant permissions. Always enable the button when not running; the onStartStop handler already routes correctly (start scanning if granted, else launch the permission request flow). Updated the helper text to point at this directly.
This commit is contained in:
@@ -70,8 +70,8 @@ class MainActivity : ComponentActivity() {
|
|||||||
threat = threat,
|
threat = threat,
|
||||||
score = maxScore,
|
score = maxScore,
|
||||||
events = events,
|
events = events,
|
||||||
canStart = granted || running,
|
canStart = true,
|
||||||
permissionMessage = if (!granted) "Bluetooth, WiFi + location permissions required" else null,
|
permissionMessage = if (!granted) "Tap START to grant Bluetooth, WiFi + location permissions" else null,
|
||||||
onStartStop = {
|
onStartStop = {
|
||||||
if (running) {
|
if (running) {
|
||||||
DetectionService.stop(this)
|
DetectionService.stop(this)
|
||||||
|
|||||||
Reference in New Issue
Block a user