Fix browser registration

This commit is contained in:
Rafał Kobyłko 2023-04-18 12:04:11 +02:00
parent 2b46c10fbf
commit 2d50c40d46
5 changed files with 14 additions and 5 deletions

View File

@ -179,7 +179,7 @@ private fun ContentScreen(
shape = ButtonShape(),
modifier = Modifier.padding(start = 72.dp, top = 6.dp, bottom = 2.dp)
) {
Text(text = "Enable Notifications".uppercase(), color = ButtonTextColor())
Text(text = "Enable Notifications", color = ButtonTextColor())
}
}
}

View File

@ -98,7 +98,7 @@ fun BrowserExtensionPermissionScreen() {
start.linkTo(parent.start)
end.linkTo(parent.end)
}) {
Text(text = stringResource(id = R.string.commons__continue).uppercase(), color = ButtonTextColor())
Text(text = stringResource(id = R.string.commons__continue), color = ButtonTextColor())
}
if (askForPermission) {

View File

@ -13,8 +13,10 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
@ -33,6 +35,7 @@ import com.twofasapp.design.compose.ButtonShape
import com.twofasapp.design.compose.ButtonTextColor
import com.twofasapp.designsystem.common.TwTopAppBar
import com.twofasapp.resources.R
import kotlinx.coroutines.launch
import org.koin.androidx.compose.get
import org.koin.androidx.compose.koinViewModel
@ -45,8 +48,14 @@ fun PairingProgressScreen(
viewModel: PairingProgressViewModel = koinViewModel(),
notificationManager: NotificationManager = get()
) {
val scope = rememberCoroutineScope()
val uiState = viewModel.uiState.collectAsState()
viewModel.pairBrowser(extensionId)
LaunchedEffect(Unit) {
scope.launch {
viewModel.pairBrowser(extensionId)
}
}
Scaffold(
topBar = {

View File

@ -65,7 +65,7 @@ internal class BrowserExtLocalSource(
suspend fun saveMobileDevice(mobileDevice: MobileDevice) {
preferences.putString(KeyMobileDevice, json.encodeToString(mobileDevice.asEntity()))
mobileDeviceFlow.tryEmit(mobileDevice)
mobileDeviceFlow.emit(mobileDevice)
}
suspend fun savePairedBrowser(pairedBrowser: PairedBrowser) {

View File

@ -17,4 +17,4 @@ internal fun MobileDeviceEntity.asDomain() = MobileDevice(
fcmToken = fcmToken,
platform = platform,
publicKey = publicKey,
)
)