소스 검색

HUE-9107 [editor] Fix history update after existing presentation mode in editor v2

Johan Ahlen 6 년 전
부모
커밋
c5fb9b41af
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      desktop/core/src/desktop/js/apps/notebook2/editorViewModel.js

+ 2 - 1
desktop/core/src/desktop/js/apps/notebook2/editorViewModel.js

@@ -25,6 +25,7 @@ import hueUtils from 'utils/hueUtils';
 
 import Notebook from 'apps/notebook2/notebook';
 import Snippet from 'apps/notebook2/snippet';
+import { UPDATE_HISTORY_EVENT } from 'apps/notebook2/components/ko.queryHistory';
 
 class EditorViewModel {
   constructor(editorId, notebooks, options, CoordinatorEditorViewModel, RunningCoordinatorModel) {
@@ -52,7 +53,7 @@ class EditorViewModel {
       this.editorMode(newVal !== 'notebook');
       hueUtils.changeURLParameter('type', newVal);
       if (this.editorMode()) {
-        this.selectedNotebook().fetchHistory(); // Js error if notebook did not have snippets
+        huePubSub.publish(UPDATE_HISTORY_EVENT);
       }
     });
     this.preEditorTogglingSnippet = ko.observable();