mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3144 Spaces | Fix | Allow deleting entry space on space-list screen (#2033)
This commit is contained in:
parent
3ff9cb6f27
commit
36bb3782e7
1 changed files with 16 additions and 20 deletions
|
@ -64,28 +64,24 @@ class SpaceListViewModel(
|
|||
SpaceId(id)
|
||||
} ?: return@buildList
|
||||
|
||||
if (spaceView.spaceAccessType == SpaceAccessType.SHARED) {
|
||||
val isOwner = permissions.get(space) == SpaceMemberPermissions.OWNER
|
||||
if (isOwner) {
|
||||
add(SpaceListItemView.Action.DeleteSpace)
|
||||
} else {
|
||||
when (spaceView.spaceAccountStatus) {
|
||||
SpaceStatus.SPACE_JOINING -> {
|
||||
add(SpaceListItemView.Action.CancelJoinRequest)
|
||||
}
|
||||
SpaceStatus.SPACE_REMOVING -> {
|
||||
add(SpaceListItemView.Action.DeleteSpace)
|
||||
}
|
||||
SpaceStatus.SPACE_ACTIVE, SpaceStatus.UNKNOWN -> {
|
||||
add(SpaceListItemView.Action.LeaveSpace)
|
||||
}
|
||||
else -> {
|
||||
// Do nothing.
|
||||
}
|
||||
val isOwner = permissions.get(space) == SpaceMemberPermissions.OWNER
|
||||
if (isOwner) {
|
||||
add(SpaceListItemView.Action.DeleteSpace)
|
||||
} else {
|
||||
when (spaceView.spaceAccountStatus) {
|
||||
SpaceStatus.SPACE_JOINING -> {
|
||||
add(SpaceListItemView.Action.CancelJoinRequest)
|
||||
}
|
||||
SpaceStatus.SPACE_REMOVING -> {
|
||||
add(SpaceListItemView.Action.DeleteSpace)
|
||||
}
|
||||
SpaceStatus.SPACE_ACTIVE, SpaceStatus.UNKNOWN -> {
|
||||
add(SpaceListItemView.Action.LeaveSpace)
|
||||
}
|
||||
else -> {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
} else if (spaceView.spaceAccessType == SpaceAccessType.PRIVATE) {
|
||||
add(SpaceListItemView.Action.DeleteSpace)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue