Skip to content

Commit

Permalink
feat: added a new condition to avoid oCIS accounts warning dialog for…
Browse files Browse the repository at this point in the history
… light users
  • Loading branch information
joragua committed Nov 26, 2024
1 parent b0ba8a1 commit a2019ce
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion owncloudApp/src/main/java/com/owncloud/android/MainApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import com.owncloud.android.dependecyinjection.viewModelModule
import com.owncloud.android.domain.capabilities.usecases.GetStoredCapabilitiesUseCase
import com.owncloud.android.domain.spaces.model.OCSpace
import com.owncloud.android.domain.spaces.usecases.GetPersonalSpaceForAccountUseCase
import com.owncloud.android.domain.user.usecases.GetUserQuotasUseCase
import com.owncloud.android.extensions.createNotificationChannel
import com.owncloud.android.lib.common.SingleSessionManager
import com.owncloud.android.presentation.authentication.AccountUtils
Expand Down Expand Up @@ -194,7 +195,13 @@ class MainApp : Application() {
}
}

spacesAllowed && personalSpace == null
val getUserQuotasUseCase: GetUserQuotasUseCase by inject()
val userQuotas = withContext(CoroutineScope(CoroutinesDispatcherProvider().io).coroutineContext) {
getUserQuotasUseCase(Unit)
}
val isLightUser = userQuotas.filter { it.accountName == account.name }.any { it.available == -4L }

spacesAllowed && personalSpace == null && !isLightUser
}

override fun onActivityStarted(activity: Activity) {
Expand Down

0 comments on commit a2019ce

Please sign in to comment.