Skip to content

Commit

Permalink
use safe call operator
Browse files Browse the repository at this point in the history
Signed-off-by: sowjanyakch <[email protected]>
  • Loading branch information
sowjanyakch committed Nov 26, 2024
1 parent 2da78f6 commit fdbff4a
Showing 1 changed file with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,21 @@ class SetStatusDialogFragment :
@SuppressLint("NotifyDataSetChanged")
override fun onNext(statusOverall: StatusOverall) {
if (statusOverall.ocs?.meta?.statusCode == HTTP_STATUS_CODE_OK) {
backupStatus = statusOverall.ocs?.data!!
if (backupStatus.message != null) {
isBackupStatusAvailable = true
val backupPredefinedStatus = PredefinedStatus(
backupStatus.userId!!,
backupStatus.icon,
backupStatus.message!!,
ClearAt(type = "period", time = backupStatus.clearAt.toString())
)
binding.automaticStatus.visibility = View.VISIBLE
adapter.isBackupStatusAvailable = true
predefinedStatusesList.add(0, backupPredefinedStatus)
adapter.notifyDataSetChanged()
statusOverall.ocs?.data?.let { status ->
backupStatus = status
if (backupStatus.message != null) {
isBackupStatusAvailable = true
val backupPredefinedStatus = PredefinedStatus(
backupStatus.userId!!,
backupStatus.icon,
backupStatus.message!!,
ClearAt(type = "period", time = backupStatus.clearAt.toString())
)
binding.automaticStatus.visibility = View.VISIBLE
adapter.isBackupStatusAvailable = true
predefinedStatusesList.add(0, backupPredefinedStatus)
adapter.notifyDataSetChanged()
}
}
}
}
Expand Down

0 comments on commit fdbff4a

Please sign in to comment.