Skip to content

Commit

Permalink
fix: wallpaper tile doesn't work after configuration rework
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Dec 9, 2024
1 parent 48a2e76 commit f65f5f1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/src/main/java/com/bnyro/wallpaper/util/BackgroundWorker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@ class BackgroundWorker(
private val workerParameters: WorkerParameters
) : CoroutineWorker(applicationContext, workerParameters) {
override suspend fun doWork(): Result {
val wallpaperConfigs = Preferences.getWallpaperConfigs()

val configId = workerParameters.inputData.getInt(WorkerHelper.WALLPAPER_CONFIG_ID, -1)
if (configId == -1) return Result.failure()
if (configId == -1) {
for (config in wallpaperConfigs) {
runWallpaperChanger(config)
}
return Result.success()
}

val config = Preferences.getWallpaperConfigs().firstOrNull {
val config = wallpaperConfigs.firstOrNull {
it.id == configId
} ?: return Result.success()

Expand Down

0 comments on commit f65f5f1

Please sign in to comment.