diff --git a/owncloudApp/src/main/java/com/owncloud/android/MainApp.kt b/owncloudApp/src/main/java/com/owncloud/android/MainApp.kt index f0c30dc2e51..9f520a3e86e 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/MainApp.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/MainApp.kt @@ -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 @@ -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) {