mirror of
https://github.com/bitwarden/android.git
synced 2026-06-06 22:42:58 -05:00
BIT-973 Get the vault URL from the repo. (#911)
This commit is contained in:
committed by
Álison Fernandes
parent
88a74d75ef
commit
ca0a38d3fa
@@ -62,10 +62,12 @@ fun AboutScreen(
|
||||
intentManager: IntentManager = LocalIntentManager.current,
|
||||
) {
|
||||
val state by viewModel.stateFlow.collectAsStateWithLifecycle()
|
||||
val context = LocalContext.current
|
||||
val resources = context.resources
|
||||
EventsEffect(viewModel = viewModel) { event ->
|
||||
when (event) {
|
||||
is AboutEvent.NavigateToWebVault -> {
|
||||
intentManager.launchUri(event.vaultUrl.toUri())
|
||||
}
|
||||
|
||||
AboutEvent.NavigateBack -> onNavigateBack.invoke()
|
||||
|
||||
AboutEvent.NavigateToHelpCenter -> {
|
||||
@@ -76,10 +78,6 @@ fun AboutScreen(
|
||||
intentManager.launchUri("https://bitwarden.com/help/about-organizations".toUri())
|
||||
}
|
||||
|
||||
AboutEvent.NavigateToWebVault -> {
|
||||
intentManager.launchUri("https://vault.bitwarden.com".toUri())
|
||||
}
|
||||
|
||||
AboutEvent.NavigateToRateApp -> {
|
||||
intentManager.launchUri(
|
||||
uri =
|
||||
@@ -181,7 +179,7 @@ private fun ContentColumn(
|
||||
BitwardenExternalLinkRow(
|
||||
text = stringResource(id = R.string.learn_org),
|
||||
onConfirmClick = onLearnAboutOrgsClick,
|
||||
dialogTitle = stringResource(id = R.string.continue_to_web_app),
|
||||
dialogTitle = stringResource(id = R.string.continue_to_x, "bitwarden.com"),
|
||||
dialogMessage = stringResource(
|
||||
id = R.string.learn_about_organizations_description_long,
|
||||
),
|
||||
|
||||
@@ -7,7 +7,8 @@ import com.x8bit.bitwarden.BuildConfig
|
||||
import com.x8bit.bitwarden.R
|
||||
import com.x8bit.bitwarden.data.platform.manager.CrashLogsManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.clipboard.BitwardenClipboardManager
|
||||
import com.x8bit.bitwarden.data.platform.repository.SettingsRepository
|
||||
import com.x8bit.bitwarden.data.platform.repository.EnvironmentRepository
|
||||
import com.x8bit.bitwarden.data.platform.repository.util.baseWebVaultUrlOrDefault
|
||||
import com.x8bit.bitwarden.data.platform.util.isFdroid
|
||||
import com.x8bit.bitwarden.ui.platform.base.BaseViewModel
|
||||
import com.x8bit.bitwarden.ui.platform.base.util.Text
|
||||
@@ -32,8 +33,8 @@ class AboutViewModel @Inject constructor(
|
||||
private val savedStateHandle: SavedStateHandle,
|
||||
private val clipboardManager: BitwardenClipboardManager,
|
||||
private val clock: Clock,
|
||||
private val settingsRepository: SettingsRepository,
|
||||
private val crashLogsManager: CrashLogsManager,
|
||||
private val environmentRepository: EnvironmentRepository,
|
||||
) : BaseViewModel<AboutState, AboutEvent, AboutAction>(
|
||||
initialState = savedStateHandle[KEY_STATE] ?: createInitialState(
|
||||
clock = clock,
|
||||
@@ -86,7 +87,11 @@ class AboutViewModel @Inject constructor(
|
||||
}
|
||||
|
||||
private fun handleWebVaultClick() {
|
||||
sendEvent(AboutEvent.NavigateToWebVault)
|
||||
sendEvent(
|
||||
AboutEvent.NavigateToWebVault(
|
||||
environmentRepository.environment.environmentUrlData.baseWebVaultUrlOrDefault,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@@ -142,7 +147,7 @@ sealed class AboutEvent {
|
||||
/**
|
||||
* Navigates to the web vault.
|
||||
*/
|
||||
data object NavigateToWebVault : AboutEvent()
|
||||
data class NavigateToWebVault(val vaultUrl: String) : AboutEvent()
|
||||
|
||||
/**
|
||||
* Navigates to rate the app.
|
||||
|
||||
Reference in New Issue
Block a user