move shareLocationToChat after check for location permission

This commit is contained in:
Chumva 2018-07-13 16:40:23 +03:00
parent 9357222b58
commit c7b8fb074d

View file

@ -77,12 +77,12 @@ class SetTimeDialogFragment : DialogFragment() {
view.findViewById<TextView>(R.id.primary_btn).apply {
text = getString(R.string.shared_string_share)
setOnClickListener {
chatIdsToDuration.forEach { chatId, expireTime ->
settings.shareLocationToChat(chatId, true, expireTime)
}
if (!AndroidUtils.isLocationPermissionAvailable(view.context)) {
AndroidUtils.requestLocationPermission(activity!!)
} else {
chatIdsToDuration.forEach { chatId, expireTime ->
settings.shareLocationToChat(chatId, true, expireTime)
}
app.shareLocationHelper.startSharingLocation()
dismiss()
}