Cleaned setting newLivePeriod
This commit is contained in:
parent
07e3660d54
commit
3c2fb27f2a
1 changed files with 3 additions and 7 deletions
|
@ -546,13 +546,9 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
|
|||
visibility = View.VISIBLE
|
||||
text = "${getText(R.string.plus)} ${OsmandFormatter.getFormattedDuration(context!!, time)}"
|
||||
setOnClickListener {
|
||||
if (shareInfo != null) {
|
||||
val newLivePeriod = settings.getChatLiveMessageExpireTime(chat.id) + shareInfo.additionalActiveTime
|
||||
settings.shareLocationToChat(chat.id, true, newLivePeriod, shareInfo.getNextAdditionalActiveTime())
|
||||
} else {
|
||||
val newLivePeriod = settings.getChatLiveMessageExpireTime(chat.id) + ADDITIONAL_ACTIVE_TIME_VALUES_SEC[0]
|
||||
settings.shareLocationToChat(chat.id, true, newLivePeriod, ADDITIONAL_ACTIVE_TIME_VALUES_SEC[1])
|
||||
}
|
||||
val newLivePeriod = settings.getChatLiveMessageExpireTime(chat.id) + (shareInfo?.additionalActiveTime ?: ADDITIONAL_ACTIVE_TIME_VALUES_SEC[0])
|
||||
val nextAdditionalActiveTime = shareInfo?.getNextAdditionalActiveTime() ?: ADDITIONAL_ACTIVE_TIME_VALUES_SEC[1]
|
||||
settings.shareLocationToChat(chat.id, true, newLivePeriod, nextAdditionalActiveTime)
|
||||
notifyItemChanged(position)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue