From 9bc31a8c6bde8fb32b48ced4e90a548427871580 Mon Sep 17 00:00:00 2001 From: Evgenii Kozlov Date: Wed, 12 Jan 2022 19:08:28 +0300 Subject: [PATCH] Editor | Fix | Objects where there is a file block with embedded pdf fail to render (#2037) --- CHANGELOG.md | 1 + .../editor/render/DefaultBlockViewRenderer.kt | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52a5842d34..6dd6bbbf6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Fixes & tech 🚒 +* Editor | Failing to render objects containing at least one file block with embedded pdf (#2037) * Editor | When trying to set a link to an object or to a web page for a text selection, the dedicated screen should not block the editor when the bottom sheet is hidden by swiping down (#2036) ## Version 0.5.0 diff --git a/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/render/DefaultBlockViewRenderer.kt b/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/render/DefaultBlockViewRenderer.kt index f1c51c70fb..6fead44ba1 100644 --- a/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/render/DefaultBlockViewRenderer.kt +++ b/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/render/DefaultBlockViewRenderer.kt @@ -976,6 +976,17 @@ class DefaultBlockViewRenderer( selection = selection ) ) + Content.File.Type.PDF -> content.toFileView( + id = block.id, + urlBuilder = urlBuilder, + indent = indent, + mode = if (mode == EditorMode.Edit) BlockView.Mode.EDIT else BlockView.Mode.READ, + isSelected = checkIfSelected( + mode = mode, + block = block, + selection = selection + ) + ) Content.File.Type.NONE -> content.toFileView( id = block.id, urlBuilder = urlBuilder,