 		}
 		return true
 	}
-	
+
+	/// caller is responsible for refreshing the content when a previewId is returned
 	private func requestPreviewId(fileId: Int) -> SignalProducer<Int, Rc2Error> {
 		let handler = SignalProducer<Int, Rc2Error> { observer, _ in
 				self.session.requestPreviewId(fileId: fileId).startWithResult { [weak self] (result) in

		}
	}

	func refreshContent() {
		guard let curDoc = parsedDocument, currentPreview != nil else {
			load(html: "")
			return

	@discardableResult
	private func loadPreviewIfNecessary() -> Bool {
		guard !initialCodeLoaded, let fileId = editorContext.value?.currentDocument.value?.file.fileId else { return false }
		// TODO: needs to update appStatus
		guard !initialCodeLoaded else { return true }
		initialCodeLoaded = true
		requestPreviewId(fileId: fileId).startWithResult { [weak self] (result) in
