|
|
@@ -102,17 +102,23 @@ class ViewController: NSViewController, NSTextViewDelegate, NSUserNotificationCe |
|
|
|
task.waitUntilExit() |
|
|
|
|
|
|
|
DispatchQueue.main.async { |
|
|
|
var notification = NSUserNotification() |
|
|
|
|
|
|
|
// All these values are optional |
|
|
|
notification.title = "Published!" |
|
|
|
notification.informativeText = "The link is copied — press ⌘+V to share it." |
|
|
|
notification.soundName = NSUserNotificationDefaultSoundName |
|
|
|
|
|
|
|
if let ad = NSApplication.shared().delegate as? AppDelegate { |
|
|
|
ad.filePublishItem.isEnabled = true |
|
|
|
} |
|
|
|
|
|
|
|
var notification = NSUserNotification() |
|
|
|
|
|
|
|
if task.terminationStatus == 0 { |
|
|
|
// Successfully published |
|
|
|
notification.title = "Published!" |
|
|
|
notification.informativeText = "The link is copied — press ⌘+V to share it." |
|
|
|
} else { |
|
|
|
// Something went wrong |
|
|
|
notification.title = "Unable to publish." |
|
|
|
notification.informativeText = "There was a problem publishing. Please check your internet and try again." |
|
|
|
} |
|
|
|
notification.soundName = NSUserNotificationDefaultSoundName |
|
|
|
|
|
|
|
NSUserNotificationCenter.default.deliver(notification) |
|
|
|
} |
|
|
|
} |
|
|
|