mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fix library updates running on metered connections
This commit is contained in:
parent
7c6b1451cb
commit
d6dccfd41b
1 changed files with 2 additions and 4 deletions
|
@ -22,11 +22,9 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
|
||||||
|
|
||||||
override fun doWork(): Result {
|
override fun doWork(): Result {
|
||||||
val preferences = Injekt.get<PreferencesHelper>()
|
val preferences = Injekt.get<PreferencesHelper>()
|
||||||
if (requiresWifiConnection(preferences) && !context.isConnectedToWifi()) {
|
return if (requiresWifiConnection(preferences) && !context.isConnectedToWifi()) {
|
||||||
Result.failure()
|
Result.failure()
|
||||||
}
|
} else if (LibraryUpdateService.start(context)) {
|
||||||
|
|
||||||
return if (LibraryUpdateService.start(context)) {
|
|
||||||
Result.success()
|
Result.success()
|
||||||
} else {
|
} else {
|
||||||
Result.failure()
|
Result.failure()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue