Skip to content

Commit

Permalink
Empty clipboard fix
Browse files Browse the repository at this point in the history
  • Loading branch information
glushchenko committed Aug 28, 2017
1 parent 2df4d6e commit 46aaae2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions FSNotes/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,15 @@ class ViewController: NSViewController,

func makeNoteShortcut() {
let clipboard = NSPasteboard.general().string(forType: NSPasteboardTypeString)
createNote(content: clipboard!)

let notification = NSUserNotification()
notification.title = "FSNotes"
notification.informativeText = "Clipboard successfully saved"
notification.soundName = NSUserNotificationDefaultSoundName
NSUserNotificationCenter.default.deliver(notification)
if (clipboard != nil) {
createNote(content: clipboard!)

let notification = NSUserNotification()
notification.title = "FSNotes"
notification.informativeText = "Clipboard successfully saved"
notification.soundName = NSUserNotificationDefaultSoundName
NSUserNotificationCenter.default.deliver(notification)
}
}

func searchShortcut() {
Expand Down

0 comments on commit 46aaae2

Please sign in to comment.