refactoring with scope functions

This commit is contained in:
shantanu1k 2022-10-29 13:49:03 +05:30
parent e39f97925f
commit 3f56311939

View File

@ -108,12 +108,16 @@ class ShareDialog(
return ""
}
private fun getShareableTitle(shareData: ShareData): String {
if (shareData.currentChannel != null) {
return shareData.currentChannel
} else if (shareData.currentPlaylist != null) {
return shareData.currentPlaylist
} else if (shareData.currentVideo != null) {
return shareData.currentVideo
shareData.apply {
currentChannel?.let {
return it
}
currentVideo?.let {
return it
}
currentPlaylist?.let {
return it
}
}
return ""
}