1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-30 14:00:07 +02:00

Fix #67: Load homepage on new Mac window

This commit is contained in:
Chen-I Lim 2021-03-08 18:38:50 -08:00
parent af7f666eff
commit 240e9c480e
2 changed files with 12 additions and 0 deletions

View File

@ -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 = ""

View File

@ -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)
}