1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-2973 Vault | Fix | Set max space count to 50 (#1716)

This commit is contained in:
Evgenii Kozlov 2024-10-22 17:19:25 +02:00 committed by Evgenii Kozlov
parent f9bb2f4c48
commit 107ccf98f5
4 changed files with 43 additions and 16 deletions

View file

@ -28,6 +28,7 @@ import com.anytypeio.anytype.gallery_experience.models.GalleryInstallationNaviga
import com.anytypeio.anytype.gallery_experience.models.GalleryInstallationSpacesState
import com.anytypeio.anytype.gallery_experience.models.GalleryInstallationState
import com.anytypeio.anytype.gallery_experience.models.GallerySpaceView
import com.anytypeio.anytype.presentation.spaces.SelectSpaceViewModel
import com.anytypeio.anytype.presentation.spaces.SpaceGradientProvider
import com.anytypeio.anytype.presentation.spaces.spaceIcon
import kotlinx.coroutines.flow.MutableSharedFlow
@ -119,6 +120,9 @@ class GalleryInstallationViewModel(
viewModelScope.launch {
command.emit(GalleryInstallationNavigation.CloseSpaces)
val state = (mainState.value as? GalleryInstallationState.Success) ?: return@launch
if (spacesViewState.value.spaces.size >= SelectSpaceViewModel.MAX_SPACE_COUNT) {
return@launch
}
val manifestInfo = state.info
mainState.value = state.copy(isLoading = true)
val params = CreateSpace.Params(