show backup status when only when status message is previously set

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2024-11-25 11:44:57 +01:00
parent 43a49494ae
commit 8bf7fd8553
No known key found for this signature in database
GPG key ID: F7AA2A8B65B50220

View file

@ -177,17 +177,19 @@ class SetStatusDialogFragment :
override fun onNext(statusOverall: StatusOverall) { override fun onNext(statusOverall: StatusOverall) {
if (statusOverall.ocs?.meta?.statusCode == HTTP_STATUS_CODE_OK) { if (statusOverall.ocs?.meta?.statusCode == HTTP_STATUS_CODE_OK) {
backupStatus = statusOverall.ocs?.data!! backupStatus = statusOverall.ocs?.data!!
isBackupStatusAvailable = true if(backupStatus.message!= null){
val backupPredefinedStatus = PredefinedStatus( isBackupStatusAvailable = true
backupStatus.userId!!, val backupPredefinedStatus = PredefinedStatus(
backupStatus.icon, backupStatus.userId!!,
backupStatus.message!!, backupStatus.icon,
ClearAt(type = "period", time = backupStatus.clearAt.toString()) backupStatus.message!!,
) ClearAt(type = "period", time = backupStatus.clearAt.toString())
binding.automaticStatus.visibility = View.VISIBLE )
adapter.isBackupStatusAvailable = true binding.automaticStatus.visibility = View.VISIBLE
predefinedStatusesList.add(0, backupPredefinedStatus) adapter.isBackupStatusAvailable = true
adapter.notifyDataSetChanged() predefinedStatusesList.add(0, backupPredefinedStatus)
adapter.notifyDataSetChanged()
}
} }
} }