From fce0a45128b7ac3482efdaa0ce4f1d65a3eef885 Mon Sep 17 00:00:00 2001 From: Mathias Jakobsen Date: Mon, 16 Jan 2023 12:02:49 +0000 Subject: [PATCH] Merge pull request #11234 from overleaf/ae-editor-type-rich-text Record `cm6-rich-text` editorType in editing session pings GitOrigin-RevId: 32d8cb60361348123bf5825961eb7e8b6e740ce8 --- services/web/frontend/js/ide.js | 2 +- services/web/frontend/js/ide/editor/EditorManager.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/services/web/frontend/js/ide.js b/services/web/frontend/js/ide.js index f7b4e9ed4d..058b9ca479 100644 --- a/services/web/frontend/js/ide.js +++ b/services/web/frontend/js/ide.js @@ -266,7 +266,7 @@ If the project has been renamed please look in your project list for a new proje editorType, } - if (editorType === 'cm6') { + if (editorType === 'cm6' || editorType === 'cm6-rich-text') { const cm6PerfData = reportCM6Perf() // Ignore if no typing has happened diff --git a/services/web/frontend/js/ide/editor/EditorManager.js b/services/web/frontend/js/ide/editor/EditorManager.js index 68fa6322b4..48b8f5d9e4 100644 --- a/services/web/frontend/js/ide/editor/EditorManager.js +++ b/services/web/frontend/js/ide/editor/EditorManager.js @@ -162,7 +162,14 @@ export default EditorManager = (function () { if (!this.$scope.editor.sharejs_doc) { return null } - return this.$scope.editor.sharejs_doc.editorType() + + let editorType = this.$scope.editor.sharejs_doc.editorType() + + if (editorType === 'cm6' && this.$scope.editor.showVisual) { + editorType = 'cm6-rich-text' + } + + return editorType } showRichText() {