mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-05 10:58:23 +00:00
Only show close app button on external requests
The close app button on the empty incoming requests screen is only useful when the screen is shown from SignerActivity. Hide it in the main activity to avoid offering a confusing way to terminate the app while browsing applications/settings.
This commit is contained in:
@@ -44,6 +44,7 @@ fun IncomingRequestScreen(
|
||||
account: Account,
|
||||
onRemoveIntentData: (List<IntentData>, IntentResultType) -> Unit,
|
||||
onLoading: (Boolean) -> Unit,
|
||||
isExternalRequest: Boolean = false,
|
||||
) {
|
||||
var loading by remember { mutableStateOf(false) }
|
||||
|
||||
@@ -66,13 +67,15 @@ fun IncomingRequestScreen(
|
||||
stringResource(R.string.why_not_explore_your_favorite_nostr_app_a_bit),
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
Spacer(Modifier.size(16.dp))
|
||||
OutlinedButton(
|
||||
onClick = {
|
||||
Amber.instance.getMainActivity()?.finishAndRemoveTask()
|
||||
},
|
||||
) {
|
||||
Text(stringResource(R.string.invalid_intent_close_app))
|
||||
if (isExternalRequest) {
|
||||
Spacer(Modifier.size(16.dp))
|
||||
OutlinedButton(
|
||||
onClick = {
|
||||
Amber.instance.getMainActivity()?.finishAndRemoveTask()
|
||||
},
|
||||
) {
|
||||
Text(stringResource(R.string.invalid_intent_close_app))
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (intents.size == 1) {
|
||||
|
||||
@@ -399,6 +399,7 @@ fun MainScreen(
|
||||
onLoading = {
|
||||
isLoading = it
|
||||
},
|
||||
isExternalRequest = isExternalRequest,
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user