mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-1105 Editor | Fix | Should map bookmark state when pasting a bookmark block (#15)
This commit is contained in:
parent
b1d54dabb0
commit
1794ba26bc
1 changed files with 10 additions and 1 deletions
|
@ -99,9 +99,18 @@ fun Block.Content.Bookmark.toMiddlewareModel(): MBBookmark = MBBookmark(
|
|||
faviconHash = favicon.orEmpty(),
|
||||
title = title.orEmpty(),
|
||||
url = url.orEmpty(),
|
||||
imageHash = image.orEmpty()
|
||||
imageHash = image.orEmpty(),
|
||||
state = state.toMiddlewareModel(),
|
||||
targetObjectId = targetObjectId.orEmpty()
|
||||
)
|
||||
|
||||
fun Block.Content.Bookmark.State.toMiddlewareModel(): MBookmarkState = when (this) {
|
||||
Block.Content.Bookmark.State.EMPTY -> MBookmarkState.Empty
|
||||
Block.Content.Bookmark.State.DONE -> MBookmarkState.Done
|
||||
Block.Content.Bookmark.State.ERROR -> MBookmarkState.Error
|
||||
Block.Content.Bookmark.State.FETCHING -> MBookmarkState.Fetching
|
||||
}
|
||||
|
||||
fun Block.Content.File.toMiddlewareModel(): MBFile = MBFile(
|
||||
hash = hash.orEmpty(),
|
||||
name = name.orEmpty(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue