DROID-2107 Merge branch 'release/0-27-0' into droid-2107-picker-crash
# Conflicts: # app/src/main/java/com/anytypeio/anytype/ui/editor/PickerDelegate.kt
This commit is contained in:
commit
4b3bdf197c
|
@ -22,6 +22,7 @@ import com.anytypeio.anytype.presentation.spaces.Command
|
|||
import com.anytypeio.anytype.presentation.spaces.SelectSpaceViewModel
|
||||
import com.anytypeio.anytype.ui.settings.typography
|
||||
import javax.inject.Inject
|
||||
import timber.log.Timber
|
||||
|
||||
class SelectSpaceFragment : BaseBottomSheetComposeFragment() {
|
||||
|
||||
|
@ -84,10 +85,14 @@ class SelectSpaceFragment : BaseBottomSheetComposeFragment() {
|
|||
findNavController().popBackStack()
|
||||
}
|
||||
is Command.SwitchToNewSpace -> {
|
||||
if (exitHomeWhenSpaceIsSelected == true) {
|
||||
findNavController().navigate(R.id.switchSpaceAction)
|
||||
} else {
|
||||
findNavController().popBackStack()
|
||||
try {
|
||||
if (exitHomeWhenSpaceIsSelected == true) {
|
||||
findNavController().navigate(R.id.switchSpaceAction)
|
||||
} else {
|
||||
findNavController().popBackStack()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Timber.e(e, "Navigation error")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ import androidx.compose.ui.unit.dp
|
|||
import androidx.compose.ui.unit.sp
|
||||
import coil.compose.rememberAsyncImagePainter
|
||||
import com.anytypeio.anytype.R
|
||||
import com.anytypeio.anytype.core_ui.extensions.throttledClick
|
||||
import com.anytypeio.anytype.core_ui.foundation.Dragger
|
||||
import com.anytypeio.anytype.core_ui.foundation.noRippleClickable
|
||||
import com.anytypeio.anytype.core_ui.views.Caption1Medium
|
||||
|
@ -154,7 +155,9 @@ private fun SelectSpaceSpaceItem(
|
|||
) {
|
||||
SpaceImageBlock(
|
||||
icon = item.view.icon,
|
||||
onSpaceIconClick = { onSpaceClicked(item.view) },
|
||||
onSpaceIconClick = throttledClick(
|
||||
onClick = { onSpaceClicked(item.view) }
|
||||
),
|
||||
gradientBackground = colorResource(id = R.color.default_gradient_background),
|
||||
gradientCornerRadius = 4.dp
|
||||
)
|
||||
|
|
|
@ -355,7 +355,7 @@ abstract class ObjectMenuViewModelBase(
|
|||
fun proceedWithCreatingWidget(obj: ObjectWrapper.Basic) {
|
||||
viewModelScope.launch {
|
||||
val config = spaceManager.getConfig()
|
||||
if (config != null) {
|
||||
if (config != null && obj.isValid) {
|
||||
createWidget(
|
||||
CreateWidget.Params(
|
||||
ctx = config.widgets,
|
||||
|
@ -378,6 +378,13 @@ abstract class ObjectMenuViewModelBase(
|
|||
}
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if (!obj.isValid) {
|
||||
sendToast("Could not create widget: object is not valid.")
|
||||
}
|
||||
if (config == null) {
|
||||
sendToast("Could not create widget: config is missing.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user