mirror of
https://github.com/mattermost/focalboard.git
synced 2024-12-27 13:48:52 +02:00
Fix #67: Load homepage on new Mac window
This commit is contained in:
parent
af7f666eff
commit
240e9c480e
@ -8,6 +8,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
static let serverStartedNotification = NSNotification.Name("serverStarted")
|
||||
|
||||
private var serverProcess: Process?
|
||||
|
||||
var isServerStarted: Bool {
|
||||
get { return serverProcess != nil }
|
||||
}
|
||||
|
||||
var serverPort = 8088
|
||||
var sessionToken: String = ""
|
||||
|
||||
|
@ -21,6 +21,13 @@ class ViewController:
|
||||
|
||||
clearWebViewCache()
|
||||
|
||||
// Load the home page if the server was started, otherwise wait until it has
|
||||
let appDelegate = NSApplication.shared.delegate as! AppDelegate
|
||||
if (appDelegate.isServerStarted) {
|
||||
self.updateSessionToken()
|
||||
self.loadHomepage()
|
||||
}
|
||||
|
||||
// Do any additional setup after loading the view.
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(onServerStarted), name: AppDelegate.serverStartedNotification, object: nil)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user