mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3397 Deep links | Fix | Misc. deep link fixes (#2145)
This commit is contained in:
parent
17a981cf35
commit
d0fcf8f527
2 changed files with 32 additions and 1 deletions
|
@ -53,6 +53,37 @@ class DefaultDeepLinkResolverTest {
|
|||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `resolve link to object deep link with invite`() {
|
||||
// Given
|
||||
|
||||
val obj = MockDataFactory.randomUuid()
|
||||
|
||||
val space = MockDataFactory.randomUuid()
|
||||
|
||||
val cid = MockDataFactory.randomUuid()
|
||||
|
||||
val encryption = MockDataFactory.randomUuid()
|
||||
|
||||
val deeplink = "anytype://object?objectId=$obj&spaceId=$space&inviteID=$cid#$encryption"
|
||||
|
||||
// When
|
||||
val result = deepLinkResolver.resolve(deeplink)
|
||||
|
||||
// Then
|
||||
assertEquals(
|
||||
DeepLinkResolver.Action.DeepLinkToObject(
|
||||
space = SpaceId(space),
|
||||
obj = obj,
|
||||
invite = DeepLinkResolver.Action.DeepLinkToObject.Invite(
|
||||
cid = cid,
|
||||
key = encryption
|
||||
)
|
||||
),
|
||||
result
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `resolve https deep link to object`() {
|
||||
// Given
|
||||
|
|
|
@ -215,7 +215,7 @@ class VaultViewModel(
|
|||
when(result) {
|
||||
is DeepLinkToObjectDelegate.Result.Error -> {
|
||||
val link = deeplink.invite
|
||||
if (link != null && result is DeepLinkToObjectDelegate.Result.Error.PermissionNeeded) {
|
||||
if (link != null) {
|
||||
commands.emit(
|
||||
Command.Deeplink.Invite(
|
||||
link = spaceInviteResolver.createInviteLink(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue