mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-361 Objects | Enhancement | Display deleted bookmark objects as inexistent objects (#2534)
This commit is contained in:
parent
807f95e853
commit
398aeac3a1
2 changed files with 29 additions and 17 deletions
|
@ -94,5 +94,7 @@ sealed class ObjectWrapper {
|
|||
val iconEmoji: String? by default
|
||||
val iconImage: String? by default
|
||||
val picture: String? by default
|
||||
val isArchived: Boolean? by default
|
||||
val isDeleted: Boolean? by default
|
||||
}
|
||||
}
|
|
@ -1207,24 +1207,34 @@ class DefaultBlockViewRenderer @Inject constructor(
|
|||
val obj = ObjectWrapper.Bookmark(
|
||||
details.details[content.targetObjectId]?.map ?: emptyMap()
|
||||
)
|
||||
BlockView.Media.Bookmark(
|
||||
id = block.id,
|
||||
url = obj.url.orEmpty(),
|
||||
title = obj.name,
|
||||
description = obj.description,
|
||||
imageUrl = obj.picture?.let { urlBuilder.image(it) },
|
||||
faviconUrl = obj.iconImage?.let { urlBuilder.image(it) },
|
||||
indent = indent,
|
||||
mode = if (mode == EditorMode.Edit) BlockView.Mode.EDIT else BlockView.Mode.READ,
|
||||
isSelected = checkIfSelected(
|
||||
mode = mode,
|
||||
if (obj.isArchived == true || obj.isDeleted == true) {
|
||||
linkDeleted(
|
||||
block = block,
|
||||
selection = selection
|
||||
),
|
||||
background = block.parseThemeBackgroundColor(),
|
||||
isPreviousBlockMedia = isPreviousBlockMedia,
|
||||
decorations = schema.toBlockViewDecoration(block)
|
||||
)
|
||||
indent = indent,
|
||||
mode = mode,
|
||||
selection = selection,
|
||||
parentSchema = schema
|
||||
)
|
||||
} else {
|
||||
BlockView.Media.Bookmark(
|
||||
id = block.id,
|
||||
url = obj.url.orEmpty(),
|
||||
title = obj.name,
|
||||
description = obj.description,
|
||||
imageUrl = obj.picture?.let { urlBuilder.image(it) },
|
||||
faviconUrl = obj.iconImage?.let { urlBuilder.image(it) },
|
||||
indent = indent,
|
||||
mode = if (mode == EditorMode.Edit) BlockView.Mode.EDIT else BlockView.Mode.READ,
|
||||
isSelected = checkIfSelected(
|
||||
mode = mode,
|
||||
block = block,
|
||||
selection = selection
|
||||
),
|
||||
background = block.parseThemeBackgroundColor(),
|
||||
isPreviousBlockMedia = isPreviousBlockMedia,
|
||||
decorations = schema.toBlockViewDecoration(block)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
BlockView.MediaPlaceholder.Bookmark(
|
||||
id = block.id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue