diff options
author | Roopesh Chander <roop@roopc.net> | 2019-03-28 19:32:58 +0530 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2019-03-28 19:32:58 +0530 |
commit | f83f159f971e4c670850b2ad7f80c7b141671dbd (patch) | |
tree | ed75f6e30290699d405d9b53ac32ce2fdb002196 | |
parent | iOS: Ability to view the log (diff) | |
download | wireguard-apple-f83f159f971e4c670850b2ad7f80c7b141671dbd.tar.xz wireguard-apple-f83f159f971e4c670850b2ad7f80c7b141671dbd.zip |
macOS: Log view: No need to disable Close button
Signed-off-by: Roopesh Chander <roop@roopc.net>
-rw-r--r-- | WireGuard/WireGuard/UI/LogViewHelper.swift | 3 | ||||
-rw-r--r-- | WireGuard/WireGuard/UI/macOS/ViewController/LogViewController.swift | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/WireGuard/WireGuard/UI/LogViewHelper.swift b/WireGuard/WireGuard/UI/LogViewHelper.swift index e3ebacd..cadd667 100644 --- a/WireGuard/WireGuard/UI/LogViewHelper.swift +++ b/WireGuard/WireGuard/UI/LogViewHelper.swift @@ -44,7 +44,8 @@ public class LogViewHelper { LogViewHelper.logEntries.append(LogEntry(timestamp: dateString, message: message)) } DispatchQueue.main.async { [weak self] in - self?.cursor = newCursor + guard let self = self else { return } + self.cursor = newCursor completion(LogViewHelper.logEntries) } } diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/LogViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/LogViewController.swift index 0816fbc..ddc8c31 100644 --- a/WireGuard/WireGuard/UI/macOS/ViewController/LogViewController.swift +++ b/WireGuard/WireGuard/UI/macOS/ViewController/LogViewController.swift @@ -94,7 +94,6 @@ class LogViewController: NSViewController { closeButton.target = self closeButton.action = #selector(closeClicked) - closeButton.isEnabled = false saveButton.target = self saveButton.action = #selector(saveClicked) @@ -153,7 +152,6 @@ class LogViewController: NSViewController { } if !self.progressIndicator.isHidden { self.progressIndicator.stopAnimation(self) - self.closeButton.isEnabled = true self.saveButton.isEnabled = true } guard !fetchedLogEntries.isEmpty else { return } |