@@ -43,6 +43,7 @@ import com.forcetower.uefs.core.task.definers.SemestersProcessor
43
43
import com.forcetower.uefs.core.util.VersionUtils
44
44
import com.forcetower.uefs.service.NotificationCreator
45
45
import com.google.firebase.crashlytics.FirebaseCrashlytics
46
+ import com.google.firebase.remoteconfig.FirebaseRemoteConfig
46
47
import dev.forcetower.breaker.Orchestra
47
48
import dev.forcetower.breaker.model.Authorization
48
49
import dev.forcetower.breaker.model.Person
@@ -64,7 +65,8 @@ class SnowpiercerSyncRepository @Inject constructor(
64
65
@Named(" webViewUA" ) agent : String ,
65
66
private val context : Context ,
66
67
private val database : UDatabase ,
67
- private val preferences : SharedPreferences
68
+ private val preferences : SharedPreferences ,
69
+ private val remoteConfig : FirebaseRemoteConfig
68
70
) {
69
71
private val orchestra = Orchestra .Builder ().client(client).userAgent(agent).build()
70
72
@@ -192,9 +194,12 @@ class SnowpiercerSyncRepository @Inject constructor(
192
194
return database.profileDao().insert(person)
193
195
}
194
196
195
- private fun onAccessInvalided () {
196
- database.accessDao().setAccessValidation(false )
197
- NotificationCreator .showInvalidAccessNotification(context)
197
+ private suspend fun onAccessInvalided () {
198
+ val access = database.accessDao().getAccessDirectSuspend() ? : return
199
+ database.accessDao().setAccessValidationDirect(false )
200
+ if (access.valid && remoteConfig.getBoolean(" show_access_invalidation_notification" )) {
201
+ NotificationCreator .showInvalidAccessNotification(context)
202
+ }
198
203
}
199
204
200
205
private suspend fun findAndMatch () {
0 commit comments