mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:05:28 +00:00
Add a way to tweak MAS url.
This commit is contained in:
committed by
Benoit Marty
parent
6ba4679908
commit
a76b55e580
+8
-2
@@ -26,6 +26,7 @@ import dev.zacsweers.metro.Assisted
|
||||
import dev.zacsweers.metro.AssistedInject
|
||||
import io.element.android.annotations.ContributesNode
|
||||
import io.element.android.compound.theme.ElementTheme
|
||||
import io.element.android.features.enterprise.api.SessionEnterpriseService
|
||||
import io.element.android.features.linknewdevice.api.LinkNewDeviceEntryPoint
|
||||
import io.element.android.features.linknewdevice.impl.screens.confirmation.CodeConfirmationNode
|
||||
import io.element.android.features.linknewdevice.impl.screens.desktop.DesktopNoticeNode
|
||||
@@ -65,6 +66,7 @@ class LinkNewDeviceFlowNode(
|
||||
private val sessionCoroutineScope: CoroutineScope,
|
||||
private val linkNewMobileHandler: LinkNewMobileHandler,
|
||||
private val linkNewDesktopHandler: LinkNewDesktopHandler,
|
||||
private val sessionEnterpriseService: SessionEnterpriseService,
|
||||
) : BaseFlowNode<LinkNewDeviceFlowNode.NavTarget>(
|
||||
backstack = BackStack(
|
||||
initialElement = NavTarget.Root,
|
||||
@@ -301,8 +303,12 @@ class LinkNewDeviceFlowNode(
|
||||
}
|
||||
}
|
||||
|
||||
private fun navigateToBrowser(url: String) {
|
||||
activity?.openUrlInChromeCustomTab(null, darkTheme, url)
|
||||
private suspend fun navigateToBrowser(url: String) {
|
||||
activity?.openUrlInChromeCustomTab(
|
||||
session = null,
|
||||
darkTheme = darkTheme,
|
||||
url = sessionEnterpriseService.tweakMasUrl(url),
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
+2
@@ -11,6 +11,7 @@ import androidx.arch.core.executor.testing.InstantTaskExecutorRule
|
||||
import com.bumble.appyx.core.modality.BuildContext
|
||||
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import io.element.android.features.enterprise.test.FakeSessionEnterpriseService
|
||||
import io.element.android.features.linknewdevice.api.LinkNewDeviceEntryPoint
|
||||
import io.element.android.libraries.matrix.test.FakeMatrixClient
|
||||
import io.element.android.tests.testutils.lambda.lambdaError
|
||||
@@ -37,6 +38,7 @@ class DefaultLinkNewDeviceEntryPointTest {
|
||||
sessionCoroutineScope = backgroundScope,
|
||||
linkNewMobileHandler = LinkNewMobileHandler(client),
|
||||
linkNewDesktopHandler = LinkNewDesktopHandler(client),
|
||||
sessionEnterpriseService = FakeSessionEnterpriseService(),
|
||||
)
|
||||
}
|
||||
val callback: LinkNewDeviceEntryPoint.Callback = object : LinkNewDeviceEntryPoint.Callback {
|
||||
|
||||
Reference in New Issue
Block a user