Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change wallpaper failed in macos 10.14 #2

Closed
xmsec opened this issue Apr 28, 2020 · 1 comment
Closed

change wallpaper failed in macos 10.14 #2

xmsec opened this issue Apr 28, 2020 · 1 comment

Comments

@xmsec
Copy link

xmsec commented Apr 28, 2020

When launch the first time, it may download last day pic without current one (Maybe download with error). So I could not click the left or right buttons to change wallpaper.
in StatusBarViewController.swift, I modified the function jumpToToday as follow:

    func jumpToToday() {
        DispatchQueue.global().async {
            self.todayButton.isEnabled = false
            self.todayButton.title = NSLocalizedString("Fetching...", comment: "N/A")
            
            if let currentRegion = SharedPreferences.string(forKey: SharedPreferences.Key.CurrentSelectedBingRegion) {
                self.bingPictureManager.fetchLastWallpaper(atRegin: currentRegion)
            }
            
            let formatter = DateFormatter()
            formatter.dateFormat = "yyyy-MM-dd"
            var validDate = Date()
            if self.jumpToDate(formatter.string(from: validDate)) == false {
                let lastTime: TimeInterval = -(24*60*60)
                validDate = validDate.addingTimeInterval(lastTime)
                let _ = self.jumpToDate(formatter.string(from: validDate))
            }
            
            
            self.todayButton.isEnabled = true
            self.todayButton.title = NSLocalizedString("Today !", comment: "N/A")
        }
    }

And it works.

@pengsrc
Copy link
Owner

pengsrc commented May 17, 2020

Hi, this issue was fixed, thanks for your feedback.

https://github.com/pengsrc/BingPaper/releases/tag/v0.10.1

@pengsrc pengsrc closed this as completed May 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants