 	
 	@discardableResult
 	private func loadPreviewIfNecessary() -> Bool {
-		guard !initialCodeLoaded, let fileId = context.value?.currentDocument.value?.file.fileId else { return false }
+		guard !initialCodeLoaded, let fileId = editorContext.value?.currentDocument.value?.file.fileId else { return false }
 		// TODO: update this to use appStatus
 		guard !initialCodeLoaded else { return true }
 		initialCodeLoaded = true

		if docHtmlLoaded || newDocument == parsedDocument  {
			Log.info("document changed with possible duplicate", .app)
		}
		guard let fileId = context.value?.currentDocument.value?.file.fileId else {
			// no file
			currentPreview = nil
			return

	}
	
	func previewUpdateStarted(response: SessionResponse.PreviewUpdateStartedData) {
//		guard let doc = parsedDocument else {
//			Log.warn("preview update witout a document", .app)
//			return
//		}
//		guard var preview = previewData[response.previewId] else { return }
		guard let fileId = editorContext.value?.currentDocument.value?.file.fileId
		else { fatalError("preview started with no editor context") }
		NotificationCenter.default.postNotificationNameOnMainThread(.previewUpdateStarted, object: session, userInfo: ["fileId": fileId])
	}
}
