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

Commit 44d4021f authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

fix after merging main

parent 79404e38
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -308,7 +308,7 @@ class MainActivity : AppCompatActivity() {
            setTitle(R.string.sign_in_failed_title)
            setTitle(R.string.sign_in_failed_title)
            setMessage(R.string.sign_in_failed_desc)
            setMessage(R.string.sign_in_failed_desc)
            setPositiveButton(R.string.retry) { _, _ ->
            setPositiveButton(R.string.retry) { _, _ ->
                viewModel.retryFetchingTokenAfterTimeout()
                viewModel.checkTokenOnTimeout()
            }
            }
            setNegativeButton(R.string.logout) { _, _ ->
            setNegativeButton(R.string.logout) { _, _ ->
                viewModel.postFalseAuthValidity()
                viewModel.postFalseAuthValidity()
+12 −5
Original line number Original line Diff line number Diff line
@@ -154,13 +154,20 @@ class MainActivityViewModel @Inject constructor(
        firstAuthDataFetchTime = 0
        firstAuthDataFetchTime = 0
        setFirstTokenFetchTime()
        setFirstTokenFetchTime()
        /*
        /*
         * Change done to show sign in error dialog for Google login.
         * Explanation:
         * 1. User type value must be present for all normal functioning.
         *    If not, post false to log out.
         * 2. If authDataJson is empty, we have not yet obtained authData even once.
         *    Hence generate authData.
         * 3. Else condition is where authDataJson is present in shared preferences, meaning
         *    we had logged in successfully at least once. Thus validate that data.
         *
         * Issue: https://gitlab.e.foundation/e/backlog/-/issues/5709
         * Issue: https://gitlab.e.foundation/e/backlog/-/issues/5709
         */
         */
        if (authDataJson.value.isNullOrEmpty()) {
        when {
            generateAuthDataBasedOnUserType(User.GOOGLE.name)
            userType.value == null -> postFalseAuthValidity()
        } else {
            authDataJson.value.isNullOrEmpty() -> generateAuthDataBasedOnUserType(userType.value!!)
            validateAuthData()
            else -> validateAuthData()
        }
        }


        /*
        /*
+1 −1
Original line number Original line Diff line number Diff line
@@ -87,7 +87,7 @@ class UpdatesFragment : TimeoutFragment(R.layout.fragment_updates), FusedAPIInte
         */
         */


        mainActivityViewModel.internetConnection.observe(viewLifecycleOwner) {
        mainActivityViewModel.internetConnection.observe(viewLifecycleOwner) {
            if (!updatesViewModel.updatesList.value?.first.isNullOrEmpty()) {
            if (!updatesViewModel.updatesList.value?.data.isNullOrEmpty()) {
                return@observe
                return@observe
            }
            }
            refreshDataOrRefreshToken(mainActivityViewModel)
            refreshDataOrRefreshToken(mainActivityViewModel)
+1 −1
Original line number Original line Diff line number Diff line
@@ -104,7 +104,7 @@ class UpdatesManagerImpl @Inject constructor(
        }
        }
    }
    }


    private fun getNonFaultyApps(list: List<FusedApp>): List<FusedApp> {
    private suspend fun getNonFaultyApps(list: List<FusedApp>): List<FusedApp> {
        val faultyAppsPackageNames = faultyAppRepository.getAllFaultyApps().map { it.packageName }
        val faultyAppsPackageNames = faultyAppRepository.getAllFaultyApps().map { it.packageName }
        return list.filter { !faultyAppsPackageNames.contains(it.package_name) }
        return list.filter { !faultyAppsPackageNames.contains(it.package_name) }
    }
    }