Skip to content

Commit

Permalink
Fixed auto updating, which it turns out... wasn't (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
superhighfives committed Mar 8, 2023
1 parent 7782242 commit e6c0d3e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Pika/AppDelegate.swift
Expand Up @@ -307,6 +307,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
NSApp.activate(ignoringOtherApps: true)
}

@IBAction func updateFeedURL(_: Any) {
SUUpdater.shared().feedURL = URL(string: PikaConstants.url())
}

@IBAction func checkForUpdates(_: Any) {
SUUpdater.shared().feedURL = URL(string: PikaConstants.url())
SUUpdater.shared()?.checkForUpdates(self)
Expand Down
2 changes: 2 additions & 0 deletions Pika/Info.plist
Expand Up @@ -34,6 +34,8 @@
<string>NSApplication</string>
<key>SUEnableAutomaticChecks</key>
<true/>
<key>SUFeedURL</key>
<string>https://superhighfives.com/releases/pika</string>
<key>SUPublicEDKey</key>
<string>+hHTCW8zfGxSQeowmFxlZzE4N/fxolLQRpA7zLlzBvk=</string>
</dict>
Expand Down
3 changes: 3 additions & 0 deletions Pika/Views/PreferencesView.swift
Expand Up @@ -77,6 +77,9 @@ struct PreferencesView: View {
Toggle(isOn: $betaUpdates) {
Text(PikaText.textBetaDescription)
}
.onReceive([self.betaUpdates].publisher.first()) { _ in
NSApp.sendAction(#selector(AppDelegate.updateFeedURL), to: nil, from: nil)
}
if appMode == .menubar {
Toggle(isOn: $hideMenuBarIcon) {
Text(PikaText.textIconDescription)
Expand Down

0 comments on commit e6c0d3e

Please sign in to comment.