mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3696 Invite link | Onboarding flow with a no approval invite link (#2469)
This commit is contained in:
parent
ab2f0ea838
commit
42e227ee69
17 changed files with 241 additions and 148 deletions
|
@ -23,6 +23,7 @@ import com.anytypeio.anytype.domain.auth.model.AuthStatus
|
|||
import com.anytypeio.anytype.domain.base.BaseUseCase
|
||||
import com.anytypeio.anytype.domain.base.Interactor
|
||||
import com.anytypeio.anytype.domain.config.ConfigStorage
|
||||
import com.anytypeio.anytype.domain.deeplink.PendingIntentStore
|
||||
import com.anytypeio.anytype.domain.misc.DeepLinkResolver
|
||||
import com.anytypeio.anytype.domain.misc.LocaleProvider
|
||||
import com.anytypeio.anytype.domain.multiplayer.SpaceInviteResolver
|
||||
|
@ -69,7 +70,8 @@ class MainViewModel(
|
|||
private val globalSubscriptionManager: GlobalSubscriptionManager,
|
||||
private val spaceInviteResolver: SpaceInviteResolver,
|
||||
private val spaceManager: SpaceManager,
|
||||
private val spaceViews: SpaceViewSubscriptionContainer
|
||||
private val spaceViews: SpaceViewSubscriptionContainer,
|
||||
private val pendingIntentStore: PendingIntentStore
|
||||
) : ViewModel(),
|
||||
NotificationActionDelegate by notificationActionDelegate,
|
||||
DeepLinkToObjectDelegate by deepLinkToObjectDelegate {
|
||||
|
@ -308,8 +310,34 @@ class MainViewModel(
|
|||
}
|
||||
}
|
||||
|
||||
fun onNewDeepLink(deeplink: DeepLinkResolver.Action) {
|
||||
fun handleNewDeepLink(deeplink: DeepLinkResolver.Action) {
|
||||
deepLinkJobs.cancel()
|
||||
viewModelScope.launch {
|
||||
checkAuthorizationStatus(Unit).process(
|
||||
failure = { Timber.e(it, "Failed to check authentication status") },
|
||||
success = { authStatus -> processDeepLinkBasedOnAuth(authStatus, deeplink) }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun processDeepLinkBasedOnAuth(
|
||||
authStatus: AuthStatus,
|
||||
deeplink: DeepLinkResolver.Action
|
||||
) {
|
||||
if (authStatus == AuthStatus.UNAUTHORIZED && deeplink is DeepLinkResolver.Action.Invite) {
|
||||
saveInviteDeepLinkForLater(deeplink)
|
||||
} else {
|
||||
Timber.d("Proceeding with deeplink: $deeplink")
|
||||
launchDeepLinkProcessing(deeplink)
|
||||
}
|
||||
}
|
||||
|
||||
private fun saveInviteDeepLinkForLater(deeplink: DeepLinkResolver.Action.Invite) {
|
||||
pendingIntentStore.setDeepLinkInvite(deeplink.link)
|
||||
Timber.d("Saved invite deeplink for later processing: ${deeplink.link}")
|
||||
}
|
||||
|
||||
private fun launchDeepLinkProcessing(deeplink: DeepLinkResolver.Action) {
|
||||
deepLinkJobs += viewModelScope.launch {
|
||||
awaitAccountStartManager
|
||||
.awaitStart()
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.anytypeio.anytype.domain.auth.interactor.CheckAuthorizationStatus
|
|||
import com.anytypeio.anytype.domain.auth.interactor.Logout
|
||||
import com.anytypeio.anytype.domain.auth.interactor.ResumeAccount
|
||||
import com.anytypeio.anytype.domain.config.ConfigStorage
|
||||
import com.anytypeio.anytype.domain.deeplink.PendingIntentStore
|
||||
import com.anytypeio.anytype.domain.misc.LocaleProvider
|
||||
import com.anytypeio.anytype.domain.multiplayer.SpaceInviteResolver
|
||||
import com.anytypeio.anytype.domain.multiplayer.SpaceViewSubscriptionContainer
|
||||
|
@ -42,7 +43,8 @@ class MainViewModelFactory @Inject constructor(
|
|||
private val globalSubscriptionManager: GlobalSubscriptionManager,
|
||||
private val spaceInviteResolver: SpaceInviteResolver,
|
||||
private val spaceManager: SpaceManager,
|
||||
private val spaceViews: SpaceViewSubscriptionContainer
|
||||
private val spaceViews: SpaceViewSubscriptionContainer,
|
||||
private val pendingIntentStore: PendingIntentStore
|
||||
) : ViewModelProvider.Factory {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
override fun <T : ViewModel> create(
|
||||
|
@ -66,6 +68,7 @@ class MainViewModelFactory @Inject constructor(
|
|||
globalSubscriptionManager = globalSubscriptionManager,
|
||||
spaceInviteResolver = spaceInviteResolver,
|
||||
spaceManager = spaceManager,
|
||||
spaceViews = spaceViews
|
||||
spaceViews = spaceViews,
|
||||
pendingIntentStore = pendingIntentStore
|
||||
) as T
|
||||
}
|
|
@ -416,23 +416,39 @@ class ShareSpaceViewModel(
|
|||
}
|
||||
|
||||
fun onRemoveMemberAccepted(identity: Id) {
|
||||
Timber.d("onRemoveMemberAccepted")
|
||||
Timber.d("onRemoveMemberAccepted: Starting member removal process for identity: $identity")
|
||||
viewModelScope.launch {
|
||||
removeSpaceMembers.async(
|
||||
RemoveSpaceMembers.Params(
|
||||
space = vmParams.space,
|
||||
identities = listOf(identity)
|
||||
try {
|
||||
removeSpaceMembers.async(
|
||||
RemoveSpaceMembers.Params(
|
||||
space = vmParams.space,
|
||||
identities = listOf(identity)
|
||||
)
|
||||
).fold(
|
||||
onFailure = { e ->
|
||||
Timber.e(
|
||||
e,
|
||||
"Error while removing space member (identity: $identity, space: ${vmParams.space})"
|
||||
)
|
||||
when (e) {
|
||||
is java.net.SocketTimeoutException,
|
||||
is java.net.UnknownHostException,
|
||||
is java.io.IOException -> {
|
||||
sendToast("Network error occurred. Please check your connection and try again.")
|
||||
}
|
||||
|
||||
else -> proceedWithMultiplayerError(e)
|
||||
}
|
||||
},
|
||||
onSuccess = {
|
||||
Timber.d("Successfully removed space member (identity: $identity, space: ${vmParams.space})")
|
||||
analytics.sendEvent(eventName = removeSpaceMember)
|
||||
}
|
||||
)
|
||||
).fold(
|
||||
onFailure = { e ->
|
||||
Timber.e(e, "Error while removing space member")
|
||||
proceedWithMultiplayerError(e)
|
||||
},
|
||||
onSuccess = {
|
||||
Timber.d("Successfully removed space member")
|
||||
analytics.sendEvent(eventName = removeSpaceMember)
|
||||
}
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
Timber.e(e, "Unexpected error while removing space member")
|
||||
sendToast("An unexpected error occurred. Please try again.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import androidx.lifecycle.ViewModelProvider
|
|||
import androidx.lifecycle.viewModelScope
|
||||
import com.anytypeio.anytype.analytics.base.Analytics
|
||||
import com.anytypeio.anytype.analytics.base.EventsDictionary
|
||||
import com.anytypeio.anytype.analytics.base.EventsDictionary.ClickOnboardingButton
|
||||
import com.anytypeio.anytype.core_models.DeviceNetworkType
|
||||
import com.anytypeio.anytype.core_models.Id
|
||||
import com.anytypeio.anytype.core_models.NetworkMode
|
||||
|
@ -16,6 +17,7 @@ import com.anytypeio.anytype.domain.network.NetworkModeProvider
|
|||
import com.anytypeio.anytype.presentation.extension.sendAnalyticsOnboardingClickEvent
|
||||
import com.anytypeio.anytype.presentation.extension.sendAnalyticsOnboardingScreenEvent
|
||||
import com.anytypeio.anytype.presentation.extension.sendOpenAccountEvent
|
||||
import com.anytypeio.anytype.domain.deeplink.PendingIntentStore
|
||||
import javax.inject.Inject
|
||||
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
|
@ -27,7 +29,8 @@ class OnboardingMnemonicViewModel @Inject constructor(
|
|||
private val analytics: Analytics,
|
||||
private val configStorage: ConfigStorage,
|
||||
private val networkModeProvider: NetworkModeProvider,
|
||||
private val networkConnectionStatus: NetworkConnectionStatus
|
||||
private val networkConnectionStatus: NetworkConnectionStatus,
|
||||
private val pendingIntentStore: PendingIntentStore
|
||||
) : ViewModel() {
|
||||
|
||||
val state = MutableStateFlow<State>(State.Idle(""))
|
||||
|
@ -35,9 +38,7 @@ class OnboardingMnemonicViewModel @Inject constructor(
|
|||
|
||||
init {
|
||||
Timber.i("OnboardingMnemonicViewModel, init")
|
||||
viewModelScope.sendAnalyticsOnboardingScreenEvent(analytics,
|
||||
EventsDictionary.ScreenOnboardingStep.PHRASE
|
||||
)
|
||||
sendScreenViewAnalytics()
|
||||
viewModelScope.launch {
|
||||
proceedWithMnemonicPhrase()
|
||||
}
|
||||
|
@ -47,92 +48,73 @@ class OnboardingMnemonicViewModel @Inject constructor(
|
|||
if (state.value is State.Mnemonic) {
|
||||
state.value = State.MnemonicOpened((state.value as State.Mnemonic).mnemonicPhrase)
|
||||
}
|
||||
viewModelScope.sendAnalyticsOnboardingClickEvent(
|
||||
analytics = analytics,
|
||||
type = EventsDictionary.ClickOnboardingButton.SHOW_AND_COPY,
|
||||
step = EventsDictionary.ScreenOnboardingStep.PHRASE
|
||||
)
|
||||
sendClickAnalytics(ClickOnboardingButton.SHOW_AND_COPY)
|
||||
}
|
||||
|
||||
fun onCheckLaterClicked(
|
||||
space: Id,
|
||||
startingObject: Id?,
|
||||
) {
|
||||
viewModelScope.sendAnalyticsOnboardingClickEvent(
|
||||
analytics = analytics,
|
||||
type = EventsDictionary.ClickOnboardingButton.CHECK_LATER,
|
||||
step = EventsDictionary.ScreenOnboardingStep.PHRASE
|
||||
)
|
||||
if (shouldShowEmail()) {
|
||||
viewModelScope.launch {
|
||||
commands.emit(
|
||||
Command.NavigateToAddEmailScreen(
|
||||
startingObject = startingObject,
|
||||
space = space
|
||||
)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
viewModelScope.launch {
|
||||
val config = configStorage.getOrNull()
|
||||
if (config != null) {
|
||||
analytics.sendOpenAccountEvent(
|
||||
analytics = config.analytics
|
||||
)
|
||||
} else {
|
||||
Timber.w("config was missing before the end of onboarding")
|
||||
}
|
||||
if (!startingObject.isNullOrEmpty()) {
|
||||
commands.emit(
|
||||
Command.OpenStartingObject(
|
||||
space = SpaceId(space),
|
||||
startingObject = startingObject
|
||||
)
|
||||
)
|
||||
} else {
|
||||
commands.emit(Command.OpenVault)
|
||||
}
|
||||
}
|
||||
fun onCheckLaterClicked(space: Id, startingObject: Id?) {
|
||||
sendClickAnalytics(ClickOnboardingButton.CHECK_LATER)
|
||||
viewModelScope.launch {
|
||||
navigateNextStep(space, startingObject)
|
||||
}
|
||||
}
|
||||
|
||||
fun onGoToTheAppClicked(
|
||||
space: Id,
|
||||
startingObject: Id?,
|
||||
) {
|
||||
if (shouldShowEmail()) {
|
||||
viewModelScope.launch {
|
||||
commands.emit(
|
||||
Command.NavigateToAddEmailScreen(
|
||||
startingObject = startingObject,
|
||||
space = space
|
||||
)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
viewModelScope.launch {
|
||||
val config = configStorage.getOrNull()
|
||||
if (config != null) {
|
||||
analytics.sendOpenAccountEvent(
|
||||
analytics = config.analytics
|
||||
)
|
||||
} else {
|
||||
Timber.w("config was missing before the end of onboarding")
|
||||
}
|
||||
if (!startingObject.isNullOrEmpty()) {
|
||||
commands.emit(
|
||||
Command.OpenStartingObject(
|
||||
space = SpaceId(space),
|
||||
startingObject = startingObject
|
||||
)
|
||||
)
|
||||
} else {
|
||||
commands.emit(Command.OpenVault)
|
||||
}
|
||||
}
|
||||
fun handleAppEntryClick(space: Id, startingObject: Id?) {
|
||||
viewModelScope.launch {
|
||||
navigateNextStep(space, startingObject)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun navigateNextStep(space: Id, startingObject: Id?) {
|
||||
if (shouldShowEmail()) {
|
||||
emitNavigateToAddEmail(space, startingObject)
|
||||
return
|
||||
}
|
||||
|
||||
logOpenAccountIfAvailable()
|
||||
|
||||
val deeplink = pendingIntentStore.getDeepLinkInvite()
|
||||
when {
|
||||
!deeplink.isNullOrEmpty() -> emitCommand(Command.OpenVault)
|
||||
!startingObject.isNullOrEmpty() -> emitCommand(
|
||||
Command.OpenStartingObject(
|
||||
space = SpaceId(space),
|
||||
startingObject = startingObject
|
||||
)
|
||||
)
|
||||
|
||||
else -> emitCommand(Command.OpenVault)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun emitNavigateToAddEmail(space: Id, startingObject: Id?) {
|
||||
emitCommand(
|
||||
Command.NavigateToAddEmailScreen(
|
||||
space = space,
|
||||
startingObject = startingObject
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private suspend fun emitCommand(command: Command) {
|
||||
commands.emit(command)
|
||||
}
|
||||
|
||||
private suspend fun logOpenAccountIfAvailable() {
|
||||
val config = configStorage.getOrNull()
|
||||
if (config != null) {
|
||||
analytics.sendOpenAccountEvent(config.analytics)
|
||||
} else {
|
||||
Timber.w("Missing config during onboarding")
|
||||
}
|
||||
}
|
||||
|
||||
private fun sendScreenViewAnalytics() {
|
||||
viewModelScope.sendAnalyticsOnboardingScreenEvent(
|
||||
analytics,
|
||||
EventsDictionary.ScreenOnboardingStep.PHRASE
|
||||
)
|
||||
}
|
||||
|
||||
fun shouldShowEmail(): Boolean {
|
||||
val networkStatus = networkConnectionStatus.getCurrentNetworkType()
|
||||
if (networkStatus == DeviceNetworkType.NOT_CONNECTED) {
|
||||
|
@ -152,13 +134,21 @@ class OnboardingMnemonicViewModel @Inject constructor(
|
|||
)
|
||||
}
|
||||
|
||||
private fun sendClickAnalytics(type: ClickOnboardingButton) {
|
||||
viewModelScope.sendAnalyticsOnboardingClickEvent(
|
||||
analytics = analytics,
|
||||
type = type,
|
||||
step = EventsDictionary.ScreenOnboardingStep.PHRASE
|
||||
)
|
||||
}
|
||||
|
||||
sealed interface State {
|
||||
|
||||
val mnemonicPhrase: String
|
||||
|
||||
class Idle(override val mnemonicPhrase: String): State
|
||||
class Mnemonic(override val mnemonicPhrase: String): State
|
||||
class MnemonicOpened(override val mnemonicPhrase: String): State
|
||||
class Idle(override val mnemonicPhrase: String) : State
|
||||
class Mnemonic(override val mnemonicPhrase: String) : State
|
||||
class MnemonicOpened(override val mnemonicPhrase: String) : State
|
||||
}
|
||||
|
||||
class Factory @Inject constructor(
|
||||
|
@ -166,7 +156,8 @@ class OnboardingMnemonicViewModel @Inject constructor(
|
|||
private val analytics: Analytics,
|
||||
private val configStorage: ConfigStorage,
|
||||
private val networkModeProvider: NetworkModeProvider,
|
||||
private val networkConnectionStatus: NetworkConnectionStatus
|
||||
private val networkConnectionStatus: NetworkConnectionStatus,
|
||||
private val pendingIntentStore: PendingIntentStore
|
||||
) : ViewModelProvider.Factory {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
override fun <T : ViewModel> create(modelClass: Class<T>): T {
|
||||
|
@ -175,7 +166,8 @@ class OnboardingMnemonicViewModel @Inject constructor(
|
|||
analytics = analytics,
|
||||
configStorage = configStorage,
|
||||
networkModeProvider = networkModeProvider,
|
||||
networkConnectionStatus = networkConnectionStatus
|
||||
networkConnectionStatus = networkConnectionStatus,
|
||||
pendingIntentStore = pendingIntentStore
|
||||
) as T
|
||||
}
|
||||
}
|
||||
|
@ -186,6 +178,7 @@ class OnboardingMnemonicViewModel @Inject constructor(
|
|||
val space: SpaceId,
|
||||
val startingObject: Id
|
||||
) : Command()
|
||||
|
||||
data class NavigateToAddEmailScreen(
|
||||
val startingObject: String?,
|
||||
val space: String
|
||||
|
|
|
@ -15,6 +15,7 @@ import com.anytypeio.anytype.domain.auth.interactor.CreateAccount
|
|||
import com.anytypeio.anytype.domain.auth.interactor.SetupWallet
|
||||
import com.anytypeio.anytype.domain.base.fold
|
||||
import com.anytypeio.anytype.domain.config.ConfigStorage
|
||||
import com.anytypeio.anytype.domain.deeplink.PendingIntentStore
|
||||
import com.anytypeio.anytype.domain.device.PathProvider
|
||||
import com.anytypeio.anytype.domain.misc.LocaleProvider
|
||||
import com.anytypeio.anytype.domain.`object`.ImportGetStartedUseCase
|
||||
|
@ -54,6 +55,7 @@ class OnboardingSetProfileNameViewModel @Inject constructor(
|
|||
private val spaceManager: SpaceManager,
|
||||
private val stringProvider: StringResourceProvider,
|
||||
private val setMembershipEmail: SetMembershipEmail,
|
||||
private val pendingIntentStore: PendingIntentStore
|
||||
) : BaseViewModel() {
|
||||
|
||||
init {
|
||||
|
@ -295,16 +297,26 @@ class OnboardingSetProfileNameViewModel @Inject constructor(
|
|||
private fun proceedWithNavigation(space: Id, startingObject: String?) {
|
||||
viewModelScope.launch {
|
||||
sendOpenAccountAnalytics()
|
||||
if (!startingObject.isNullOrEmpty()) {
|
||||
navigation.emit(
|
||||
OpenStartingObject(
|
||||
space = SpaceId(space),
|
||||
startingObject = startingObject
|
||||
)
|
||||
navigateNextStep(
|
||||
space = space,
|
||||
startingObject = startingObject
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun navigateNextStep(space: Id, startingObject: Id?) {
|
||||
delay(LOADING_AFTER_SUCCESS_DELAY)
|
||||
val deeplink = pendingIntentStore.getDeepLinkInvite()
|
||||
when {
|
||||
!deeplink.isNullOrEmpty() -> navigation.emit(Navigation.OpenVault)
|
||||
!startingObject.isNullOrEmpty() -> navigation.emit(
|
||||
OpenStartingObject(
|
||||
space = SpaceId(space),
|
||||
startingObject = startingObject
|
||||
)
|
||||
} else {
|
||||
navigation.emit(Navigation.OpenVault)
|
||||
}
|
||||
)
|
||||
|
||||
else -> navigation.emit(Navigation.OpenVault)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -359,7 +371,8 @@ class OnboardingSetProfileNameViewModel @Inject constructor(
|
|||
private val globalSubscriptionManager: GlobalSubscriptionManager,
|
||||
private val spaceManager: SpaceManager,
|
||||
private val stringProvider: StringResourceProvider,
|
||||
private val setMembershipEmail: SetMembershipEmail
|
||||
private val setMembershipEmail: SetMembershipEmail,
|
||||
private val pendingIntentStore: PendingIntentStore
|
||||
) : ViewModelProvider.Factory {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
override fun <T : ViewModel> create(modelClass: Class<T>): T {
|
||||
|
@ -378,7 +391,8 @@ class OnboardingSetProfileNameViewModel @Inject constructor(
|
|||
globalSubscriptionManager = globalSubscriptionManager,
|
||||
spaceManager = spaceManager,
|
||||
stringProvider = stringProvider,
|
||||
setMembershipEmail = setMembershipEmail
|
||||
setMembershipEmail = setMembershipEmail,
|
||||
pendingIntentStore = pendingIntentStore
|
||||
) as T
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ import com.anytypeio.anytype.core_models.primitives.Space
|
|||
import com.anytypeio.anytype.core_models.primitives.SpaceId
|
||||
import com.anytypeio.anytype.domain.base.fold
|
||||
import com.anytypeio.anytype.domain.chats.ChatPreviewContainer
|
||||
import com.anytypeio.anytype.domain.deeplink.PendingIntentStore
|
||||
import com.anytypeio.anytype.domain.misc.AppActionManager
|
||||
import com.anytypeio.anytype.domain.misc.DeepLinkResolver
|
||||
import com.anytypeio.anytype.domain.misc.UrlBuilder
|
||||
|
@ -48,7 +49,6 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
|||
import kotlinx.coroutines.flow.SharingStarted
|
||||
import kotlinx.coroutines.flow.combine
|
||||
import kotlinx.coroutines.flow.debounce
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.flow.emitAll
|
||||
import kotlinx.coroutines.flow.flow
|
||||
import kotlinx.coroutines.flow.map
|
||||
|
@ -64,8 +64,6 @@ class VaultViewModel(
|
|||
private val getSpaceWallpapers: GetSpaceWallpapers,
|
||||
private val spaceManager: SpaceManager,
|
||||
private val saveCurrentSpace: SaveCurrentSpace,
|
||||
private val getVaultSettings: GetVaultSettings,
|
||||
private val setVaultSettings: SetVaultSettings,
|
||||
private val observeVaultSettings: ObserveVaultSettings,
|
||||
private val setVaultSpaceOrder: SetVaultSpaceOrder,
|
||||
private val analytics: Analytics,
|
||||
|
@ -73,7 +71,8 @@ class VaultViewModel(
|
|||
private val appActionManager: AppActionManager,
|
||||
private val spaceInviteResolver: SpaceInviteResolver,
|
||||
private val profileContainer: ProfileSubscriptionManager,
|
||||
private val chatPreviewContainer: ChatPreviewContainer
|
||||
private val chatPreviewContainer: ChatPreviewContainer,
|
||||
private val pendingIntentStore: PendingIntentStore
|
||||
) : NavigationViewModel<VaultViewModel.Navigation>(), DeepLinkToObjectDelegate by deepLinkToObjectDelegate {
|
||||
|
||||
val spaces = MutableStateFlow<List<VaultSpaceView>>(emptyList())
|
||||
|
@ -261,6 +260,17 @@ class VaultViewModel(
|
|||
}
|
||||
}
|
||||
|
||||
fun processPendingDeeplink() {
|
||||
viewModelScope.launch {
|
||||
delay(1000) // Simulate some delay
|
||||
pendingIntentStore.getDeepLinkInvite()?.let { deeplink ->
|
||||
Timber.d("Processing pending deeplink: $deeplink")
|
||||
commands.emit(Command.Deeplink.Invite(deeplink))
|
||||
pendingIntentStore.clearDeepLinkInvite()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun proceedWithSavingCurrentSpace(
|
||||
targetSpace: String,
|
||||
chat: Id?,
|
||||
|
@ -357,8 +367,6 @@ class VaultViewModel(
|
|||
private val urlBuilder: UrlBuilder,
|
||||
private val spaceManager: SpaceManager,
|
||||
private val saveCurrentSpace: SaveCurrentSpace,
|
||||
private val getVaultSettings: GetVaultSettings,
|
||||
private val setVaultSettings: SetVaultSettings,
|
||||
private val setVaultSpaceOrder: SetVaultSpaceOrder,
|
||||
private val observeVaultSettings: ObserveVaultSettings,
|
||||
private val analytics: Analytics,
|
||||
|
@ -366,7 +374,8 @@ class VaultViewModel(
|
|||
private val appActionManager: AppActionManager,
|
||||
private val spaceInviteResolver: SpaceInviteResolver,
|
||||
private val profileContainer: ProfileSubscriptionManager,
|
||||
private val chatPreviewContainer: ChatPreviewContainer
|
||||
private val chatPreviewContainer: ChatPreviewContainer,
|
||||
private val pendingIntentStore: PendingIntentStore
|
||||
) : ViewModelProvider.Factory {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
override fun <T : ViewModel> create(
|
||||
|
@ -377,8 +386,6 @@ class VaultViewModel(
|
|||
urlBuilder = urlBuilder,
|
||||
spaceManager = spaceManager,
|
||||
saveCurrentSpace = saveCurrentSpace,
|
||||
getVaultSettings = getVaultSettings,
|
||||
setVaultSettings = setVaultSettings,
|
||||
setVaultSpaceOrder = setVaultSpaceOrder,
|
||||
observeVaultSettings = observeVaultSettings,
|
||||
analytics = analytics,
|
||||
|
@ -386,7 +393,8 @@ class VaultViewModel(
|
|||
appActionManager = appActionManager,
|
||||
spaceInviteResolver = spaceInviteResolver,
|
||||
profileContainer = profileContainer,
|
||||
chatPreviewContainer = chatPreviewContainer
|
||||
chatPreviewContainer = chatPreviewContainer,
|
||||
pendingIntentStore = pendingIntentStore
|
||||
) as T
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue