 //  along with Hipstapaper.  If not, see <http://www.gnu.org/licenses/>.
 //
 
+import Combine
 import AppKit
+import SwiftUI
 import Browse
-import SwiftUI
 
 class BrowserWindowController: NSWindowController {
     
     let url: URL
     var windowWillClose: ((URL) -> Void)?
+    var browserToken: AnyCancellable?
     
     init(url: URL) {
         self.url = url

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}

extension BrowserWindowController: NSWindowDelegate {

    override func showWindow(_ sender: Any?) {
        if self.window == nil {
            let vm = Browse.ViewModel(url: self.url, doneAction: nil)
            self.browserToken = vm.$browserDisplay.sink()
            { [unowned self] display in
                self.window?.title = display.title
            }
            let browser = Browser(vm)
            let vc = NSHostingController(rootView: browser)
            let window = NSWindow(contentViewController: vc)
