瀏覽代碼

HUE-8758 [connectors] Fix js exception from jobs panel

Johan Ahlen 5 年之前
父節點
當前提交
589201b4ff
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      desktop/core/src/desktop/js/apps/notebook/editorViewModel.js

+ 6 - 6
desktop/core/src/desktop/js/apps/notebook/editorViewModel.js

@@ -291,7 +291,7 @@ class EditorViewModel {
       }
     });
 
-    const withActiveSnippet = function(callback) {
+    this.withActiveSnippet = function(callback) {
       const notebook = self.selectedNotebook();
       let foundSnippet;
       if (notebook) {
@@ -321,7 +321,7 @@ class EditorViewModel {
     huePubSub.subscribe(
       GET_ACTIVE_SNIPPET_CONNECTOR_EVENT,
       callback => {
-        withActiveSnippet(activeSnippet => {
+        this.withActiveSnippet(activeSnippet => {
           callback(activeSnippet.connector());
         });
       },
@@ -331,7 +331,7 @@ class EditorViewModel {
     huePubSub.subscribe(
       'save.snippet.to.file',
       () => {
-        withActiveSnippet(activeSnippet => {
+        this.withActiveSnippet(activeSnippet => {
           const data = {
             path: activeSnippet.statementPath(),
             contents: activeSnippet.statement()
@@ -354,7 +354,7 @@ class EditorViewModel {
     huePubSub.subscribe(
       'sql.context.pin',
       contextData => {
-        withActiveSnippet(activeSnippet => {
+        this.withActiveSnippet(activeSnippet => {
           contextData.tabId = 'context' + activeSnippet.pinnedContextTabs().length;
           activeSnippet.pinnedContextTabs.push(contextData);
           activeSnippet.currentQueryTab(contextData.tabId);
@@ -366,7 +366,7 @@ class EditorViewModel {
     huePubSub.subscribe(
       'assist.database.set',
       entry => {
-        withActiveSnippet(activeSnippet => {
+        this.withActiveSnippet(activeSnippet => {
           activeSnippet.handleAssistSelection(entry);
         });
       },
@@ -376,7 +376,7 @@ class EditorViewModel {
     huePubSub.subscribe(
       'assist.database.selected',
       entry => {
-        withActiveSnippet(activeSnippet => {
+        this.withActiveSnippet(activeSnippet => {
           activeSnippet.handleAssistSelection(entry);
         });
       },