mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Check if the Micro.blog app exists on disk when app becomes active.
This commit is contained in:
@@ -6,26 +6,37 @@
|
||||
// Copyright © 2018 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Cocoa
|
||||
|
||||
// Not undoable.
|
||||
|
||||
struct SendToMicroBlogCommand: SendToCommand {
|
||||
final class SendToMicroBlogCommand: SendToCommand {
|
||||
|
||||
private let bundleID = "blog.micro.mac"
|
||||
private var appExists = false
|
||||
|
||||
init() {
|
||||
|
||||
self.appExists = appExistsOnDisk(bundleID)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(appDidBecomeActive(_:)), name: NSApplication.didBecomeActiveNotification, object: nil)
|
||||
}
|
||||
|
||||
func canSendObject(_ object: Any?) -> Bool {
|
||||
|
||||
if !appExists {
|
||||
return false
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func sendObject(_ object: Any?) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private extension SendToMicroBlogCommand {
|
||||
@objc func appDidBecomeActive(_ note: Notification) {
|
||||
|
||||
func appExists() {
|
||||
|
||||
|
||||
self.appExists = appExistsOnDisk(bundleID)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user