Explorar o código

HUE-6494 [assist] Avoid JS error on huePubSub assist.document.refresh

Enrico Berti %!s(int64=8) %!d(string=hai) anos
pai
achega
21a9f4d7f2
Modificáronse 1 ficheiros con 8 adicións e 2 borrados
  1. 8 2
      desktop/core/src/desktop/templates/assist.mako

+ 8 - 2
desktop/core/src/desktop/templates/assist.mako

@@ -1116,7 +1116,7 @@ from notebook.conf import get_ordered_interpreters
         var self = this;
 
         self.activeEntry = ko.observable();
-        self.activeEntry(new HueFileEntry({
+        var root = new HueFileEntry({
           activeEntry: self.activeEntry,
           trashEntry: ko.observable,
           apiHelper: options.apiHelper,
@@ -1127,7 +1127,13 @@ from notebook.conf import get_ordered_interpreters
             name: '/',
             type: 'directory'
           }
-        }));
+        });
+        self.activeEntry(root);
+
+        self.reload = function () {
+          self.activeEntry(root);
+          self.activeEntry().load();
+        };
 
         huePubSub.subscribe('assist.document.refresh', function () {
           huePubSub.publish('assist.clear.document.cache');