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

Commit 7b55b033 authored by Hasib Prince's avatar Hasib Prince
Browse files

fixed: installing pwa

parent adf7ef42
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1229,7 +1229,7 @@ class FusedApiImpl @Inject constructor(
     * Recommended to use this instead of [PkgManagerModule.getPackageStatus].
     */
    override fun getFusedAppInstallationStatus(fusedApp: FusedApp): Status {
        return if (fusedApp.isPwa) {
        return if (fusedApp.is_pwa) {
            pwaManagerModule.getPwaStatus(fusedApp)
        } else {
            pkgManagerModule.getPackageStatus(fusedApp.package_name, fusedApp.latest_version_code)
@@ -1243,12 +1243,12 @@ class FusedApiImpl @Inject constructor(
    }

    private fun FusedApp.updateType() {
        this.type = if (this.isPwa) Type.PWA else Type.NATIVE
        this.type = if (this.is_pwa) Type.PWA else Type.NATIVE
    }

    private fun FusedApp.updateSource() {
        this.apply {
            source = if (origin == Origin.CLEANAPK && isPwa) {
            source = if (origin == Origin.CLEANAPK && is_pwa) {
                context.getString(R.string.pwa)
            } else if (origin == Origin.CLEANAPK) {
                context.getString(R.string.open_source)
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ data class FusedApp(
    var source: String = String(),
    val price: String = String(),
    val isFree: Boolean = true,
    val isPwa: Boolean = false,
    val is_pwa: Boolean = false,
    var pwaPlayerDbId: Long = -1,
    val url: String = String(),
    var type: Type = Type.NATIVE,
+1 −1
Original line number Diff line number Diff line
@@ -756,7 +756,7 @@ class ApplicationFragment : Fragment(R.layout.fragment_application) {
            backgroundTintList =
                ContextCompat.getColorStateList(view.context, R.color.colorAccent)
            setOnClickListener {
                if (fusedApp.isPwa) {
                if (fusedApp.is_pwa) {
                    pwaManagerModule.launchPwa(fusedApp)
                } else {
                    startActivity(pkgManagerModule.getLaunchIntent(fusedApp.package_name))
+1 −1
Original line number Diff line number Diff line
@@ -51,6 +51,6 @@ class ApplicationDiffUtil : DiffUtil.ItemCallback<FusedApp>() {
            ((oldItem.trackers == LIST_OF_NULL && newItem.trackers.isEmpty()) || oldItem.trackers == newItem.trackers) &&
            oldItem.url.contentEquals(newItem.url) &&
            oldItem.isFree == newItem.isFree &&
            oldItem.isPwa == newItem.isPwa
            oldItem.is_pwa == newItem.is_pwa
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -527,7 +527,7 @@ class ApplicationListRVAdapter(
            enableInstallButton(Status.INSTALLED)
            text = context.getString(R.string.open)
            setOnClickListener {
                if (searchApp.isPwa) {
                if (searchApp.is_pwa) {
                    mainActivityViewModel.launchPwa(searchApp)
                } else {
                    context.startActivity(
Loading