From 854cf1834aba3b1175c880f99231ab12cb602f3d Mon Sep 17 00:00:00 2001 From: Cola Chen <6825116+colachg@users.noreply.github.com> Date: Wed, 25 Feb 2026 22:50:33 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(dislike):=20stay=20on=20curr?= =?UTF-8?q?ent=20wallpaper=20when=20disliking=20instead=20of=20auto-advanc?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove auto-navigation from dislike() so the wallpaper stays visible after marking as disliked. Make undoDislike() apply the wallpaper to the desktop when undoing from preview-only mode. Remove dead navigateToNextNonDisliked() method. Bump version to v1.1.2. --- Resources/Info.plist | 4 ++-- Sources/Wallpaper/WallpaperApp.swift | 4 ++-- Sources/Wallpaper/WallpaperManager.swift | 19 ++++--------------- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/Resources/Info.plist b/Resources/Info.plist index eca42b7..0254a8f 100644 --- a/Resources/Info.plist +++ b/Resources/Info.plist @@ -9,9 +9,9 @@ CFBundleExecutable Wallpaper CFBundleVersion - 1.1.1 + 1.1.2 CFBundleShortVersionString - 1.1.1 + 1.1.2 CFBundlePackageType APPL CFBundleIconFile diff --git a/Sources/Wallpaper/WallpaperApp.swift b/Sources/Wallpaper/WallpaperApp.swift index 6249c5f..0c12a3b 100644 --- a/Sources/Wallpaper/WallpaperApp.swift +++ b/Sources/Wallpaper/WallpaperApp.swift @@ -91,9 +91,9 @@ struct WallpaperApp: App { enabled: !manager.images.isEmpty ) { if manager.isCurrentDisliked { - manager.undoDislike() + Task { await manager.undoDislike() } } else { - Task { await manager.dislike() } + manager.dislike() } } .help(manager.isCurrentDisliked ? "Unskip" : "Skip this wallpaper") diff --git a/Sources/Wallpaper/WallpaperManager.swift b/Sources/Wallpaper/WallpaperManager.swift index 019b233..d151efb 100644 --- a/Sources/Wallpaper/WallpaperManager.swift +++ b/Sources/Wallpaper/WallpaperManager.swift @@ -260,18 +260,19 @@ class WallpaperManager { // MARK: - Like/Dislike/Favorite Actions - func dislike() async { + func dislike() { guard currentIndex >= 0, currentIndex < images.count else { return } let image = images[currentIndex] store.addDislike(image.startdate) // Remove from favorites if present store.removeFavorite(image) - await navigateToNextNonDisliked() } - func undoDislike() { + func undoDislike() async { guard currentIndex >= 0, currentIndex < images.count else { return } store.removeDislike(images[currentIndex].startdate) + do { try await applyWallpaper(at: currentIndex) } + catch { errorMessage = error.localizedDescription } } func toggleFavorite() { @@ -313,18 +314,6 @@ class WallpaperManager { return NSImage(contentsOf: localURL) } - private func navigateToNextNonDisliked() async { - // Try newer images first (lower indices), then older images - let candidates = Array(0..