clear permissions when GET_PUBLIC_KEY

This commit is contained in:
greenart7c3
2023-11-22 08:01:51 -03:00
parent f4739657fc
commit a2ccf08664
2 changed files with 4 additions and 6 deletions
@@ -87,6 +87,9 @@ fun sendResult(
) {
val activity = context.getAppCompatActivity()
if (packageName != null) {
if (intentData.type == SignerType.GET_PUBLIC_KEY) {
account.savedApps.clear()
}
permissions?.filter { it.checked }?.forEach {
val type = it.type.toUpperCase(Locale.current)
val permissionKey = if (it.type == "sign_event") "$packageName-$type-${it.kind}" else "$packageName-$type"
@@ -3,13 +3,11 @@ package com.greenart7c3.nostrsigner.ui.components
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.greenart7c3.nostrsigner.ui.theme.ButtonBorder
@@ -26,10 +24,7 @@ fun RawJsonButton(
) {
TextButton(
shape = ButtonBorder,
onClick = onCLick,
colors = ButtonDefaults.textButtonColors(
contentColor = Color.Black
)
onClick = onCLick
) {
Text(text)
}