瀏覽代碼

HUE-8330 [frontend] Prevent initial js error in the dw sidebar when no app is set

Johan Ahlen 7 年之前
父節點
當前提交
cdbcbcd
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      desktop/core/src/desktop/templates/ko_components/ko_dw_sidebar.mako

+ 3 - 0
desktop/core/src/desktop/templates/ko_components/ko_dw_sidebar.mako

@@ -81,6 +81,9 @@
         var throttle = -1;
         huePubSub.subscribe('set.current.app.name', function (appName) {
           window.clearTimeout(throttle);
+          if (!appName) {
+            return;
+          }
           throttle = window.setTimeout(function () {
             self.items().some(function (item) {
               return item.children.some(function (child) {