1
0
Fork 0
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:
Evgenii Kozlov 2025-03-10 16:53:28 +01:00
parent 17a981cf35
commit d0fcf8f527
2 changed files with 32 additions and 1 deletions

View file

@ -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

View file

@ -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(