Skip to content

Commit

Permalink
AND-18791: Fix getMyChatFilesFolder non-fatal exception
Browse files Browse the repository at this point in the history
  • Loading branch information
lhmega committed May 21, 2024
1 parent efaa1f9 commit 09e0316
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ import timber.log.Timber
import java.io.File
import java.lang.ref.WeakReference
import javax.inject.Inject

@HiltViewModel
class ImagePreviewViewModel @Inject constructor(
private val savedStateHandle: SavedStateHandle,
Expand Down Expand Up @@ -872,13 +871,13 @@ class ImagePreviewViewModel @Inject constructor(
)
}

private suspend fun isHidingActionAllowed(): Boolean =
private suspend fun isHidingActionAllowed(): Boolean = runCatching {
(getParentNodeUseCase(NodeId(currentImageNodeIdValue))?.id?.longValue ?: 0) !in listOf(
getPrimarySyncHandleUseCase(),
getSecondarySyncHandleUseCase(),
getMyChatsFilesFolderIdUseCase(),
)

}.getOrElse { false }

companion object {
const val IMAGE_NODE_FETCHER_SOURCE = "image_node_fetcher_source"
Expand All @@ -888,3 +887,4 @@ class ImagePreviewViewModel @Inject constructor(
const val IMAGE_PREVIEW_IS_FOREIGN = "image_preview_is_foreign"
}
}

0 comments on commit 09e0316

Please sign in to comment.