forked from melod1n/fast-messenger
Prevent PhotoViewer share/copy while loading
This commit prevents the share and copy actions in the PhotoViewer from being triggered if the content is still loading.
This commit is contained in:
@@ -79,6 +79,8 @@ class PhotoViewViewModelImpl(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onShareClicked() {
|
override fun onShareClicked() {
|
||||||
|
if (screenState.value.isLoading) return
|
||||||
|
|
||||||
val url = screenState.value.images
|
val url = screenState.value.images
|
||||||
.getOrNull(screenState.value.selectedPage)
|
.getOrNull(screenState.value.selectedPage)
|
||||||
?.extractUrl() ?: return
|
?.extractUrl() ?: return
|
||||||
@@ -137,6 +139,8 @@ class PhotoViewViewModelImpl(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onCopyClicked() {
|
override fun onCopyClicked() {
|
||||||
|
if (screenState.value.isLoading) return
|
||||||
|
|
||||||
val clipboardManager =
|
val clipboardManager =
|
||||||
applicationContext.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
applicationContext.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user