From 4565893787dcd89dd471725db42cc112e16ff566 Mon Sep 17 00:00:00 2001 From: Anthonyy232 Date: Sat, 28 Mar 2026 11:38:28 -0700 Subject: [PATCH] refactor: rename shadowed local variable in addWallpapers Local `val wallpapers` shadowed the `StateFlow> wallpapers` class property, making it hard to tell which was being referenced. Renamed to `newWallpapers` for clarity. Co-Authored-By: Claude Sonnet 4.6 --- .../presentation/screens/album_view/AlbumViewViewModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/anthonyla/paperize/presentation/screens/album_view/AlbumViewViewModel.kt b/app/src/main/java/com/anthonyla/paperize/presentation/screens/album_view/AlbumViewViewModel.kt index e8adcc0..0bf21c9 100644 --- a/app/src/main/java/com/anthonyla/paperize/presentation/screens/album_view/AlbumViewViewModel.kt +++ b/app/src/main/java/com/anthonyla/paperize/presentation/screens/album_view/AlbumViewViewModel.kt @@ -83,7 +83,7 @@ class AlbumViewViewModel @Inject constructor( fun addWallpapers(uris: List) { viewModelScope.launch { val existingCount = wallpapers.value.size - val wallpapers = uris.mapIndexed { index, uri -> + val newWallpapers = uris.mapIndexed { index, uri -> val parsedUri = uri.toUri() val mediaType = parsedUri.detectMediaType(context) ?: WallpaperMediaType.IMAGE @@ -98,7 +98,7 @@ class AlbumViewViewModel @Inject constructor( mediaType = mediaType ) } - when (val result = albumRepository.addWallpapersToAlbum(albumId, wallpapers)) { + when (val result = albumRepository.addWallpapersToAlbum(albumId, newWallpapers)) { is com.anthonyla.paperize.core.Result.Success -> { // Clear queues so the new wallpapers are included on the next cycle wallpaperRepository.clearQueuesForAlbum(albumId)