diff --git a/mobile/src/foss/java/org/openhab/habdroid/core/CloudMessagingHelper.kt b/mobile/src/foss/java/org/openhab/habdroid/core/CloudMessagingHelper.kt index 7046160232..32ee093088 100644 --- a/mobile/src/foss/java/org/openhab/habdroid/core/CloudMessagingHelper.kt +++ b/mobile/src/foss/java/org/openhab/habdroid/core/CloudMessagingHelper.kt @@ -26,6 +26,7 @@ import org.openhab.habdroid.core.connection.ConnectionFactory import org.openhab.habdroid.core.connection.NotACloudServerException import org.openhab.habdroid.model.CloudMessage import org.openhab.habdroid.model.toCloudMessage +import org.openhab.habdroid.ui.CloudNotificationListFragment import org.openhab.habdroid.ui.preference.PushNotificationStatus import org.openhab.habdroid.util.HttpClient import org.openhab.habdroid.util.PrefKeys @@ -65,7 +66,7 @@ object CloudMessagingHelper { } private suspend fun loadNewMessages(context: Context, connection: Connection): List? { - val url = "api/v1/notifications?limit=20" + val url = "api/v1/notifications?limit=${CloudNotificationListFragment.PAGE_SIZE}" val messages = try { val response = connection.httpClient.get(url).asText().response Log.d(TAG, "Notifications request success") diff --git a/mobile/src/main/java/org/openhab/habdroid/ui/CloudNotificationListFragment.kt b/mobile/src/main/java/org/openhab/habdroid/ui/CloudNotificationListFragment.kt index 4221f09229..070dc5f53a 100644 --- a/mobile/src/main/java/org/openhab/habdroid/ui/CloudNotificationListFragment.kt +++ b/mobile/src/main/java/org/openhab/habdroid/ui/CloudNotificationListFragment.kt @@ -210,9 +210,9 @@ class CloudNotificationListFragment : Fragment(), View.OnClickListener, SwipeRef } companion object { - private val TAG = CloudNotificationListFragment::class.java.simpleName + const val PAGE_SIZE = 50 - private const val PAGE_SIZE = 20 + private val TAG = CloudNotificationListFragment::class.java.simpleName fun newInstance(highlightedId: String?, primaryServer: Boolean): CloudNotificationListFragment { val f = CloudNotificationListFragment()