Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9132417 authored by Nihar Thakkar's avatar Nihar Thakkar
Browse files

Revert "small impovement"

This reverts commit 1ddf742b
parent 8b91a8fa
Loading
Loading
Loading
Loading
+24 −6
Original line number Diff line number Diff line
@@ -12,6 +12,29 @@ import io.eelo.appinstaller.utils.Execute

class CategoryModel : CategoryModelInterface {

    override fun loadMore(context: Context) {
        var apps: ArrayList<Application>? = null
        if (Common.isNetworkAvailable(context)) {
            Execute({
                apps = loadApplicationsSynced(context)
            }, {
                if (error == null && apps != null) {
                    val result = ArrayList<Application>()
                    result.addAll(categoryApplicationsList.value!!)
                    result.addAll(apps!!)
                    if (apps!!.size != 0) {
                        categoryApplicationsList.value = result
                    }
                } else {
                    screenError.value = error
                }
            })
            page++
        } else {
            screenError.value = Error.NO_INTERNET
        }
    }

    lateinit var applicationManager: ApplicationManager
    lateinit var category: String
    private var page = 1
@@ -37,12 +60,7 @@ class CategoryModel : CategoryModelInterface {
                apps = loadApplicationsSynced(context)
            }, {
                if (error == null && apps != null) {
                    val result = ArrayList<Application>()
                    result.addAll(categoryApplicationsList.value!!)
                    result.addAll(apps!!)
                    if (apps!!.size != 0) {
                        categoryApplicationsList.value = result
                    }
                    categoryApplicationsList.value = apps
                } else {
                    screenError.value = error
                }
+2 −0
Original line number Diff line number Diff line
@@ -8,4 +8,6 @@ interface CategoryModelInterface {
    fun initialise(applicationManager: ApplicationManager, category: String)

    fun loadApplications(context: Context)

    fun loadMore(context: Context)
}
 No newline at end of file