From 8bf7fd8553f34139a47ae458940227e4c72de09c Mon Sep 17 00:00:00 2001 From: sowjanyakch Date: Mon, 25 Nov 2024 11:44:57 +0100 Subject: [PATCH] show backup status when only when status message is previously set Signed-off-by: sowjanyakch --- .../talk/ui/dialog/SetStatusDialogFragment.kt | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/ui/dialog/SetStatusDialogFragment.kt b/app/src/main/java/com/nextcloud/talk/ui/dialog/SetStatusDialogFragment.kt index 567c16af3..84aaaf3cd 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/dialog/SetStatusDialogFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/ui/dialog/SetStatusDialogFragment.kt @@ -177,17 +177,19 @@ class SetStatusDialogFragment : override fun onNext(statusOverall: StatusOverall) { if (statusOverall.ocs?.meta?.statusCode == HTTP_STATUS_CODE_OK) { backupStatus = statusOverall.ocs?.data!! - 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() + 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() + } } }