瀏覽代碼

HUE-9354 [editor] Prevent grayed out result when fetch_result_data returns empty data in editor v2

Johan Ahlen 5 年之前
父節點
當前提交
775b3efe7f
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      desktop/core/src/desktop/js/apps/notebook2/components/resultGrid/ko.resultGrid.js

+ 8 - 0
desktop/core/src/desktop/js/apps/notebook2/components/resultGrid/ko.resultGrid.js

@@ -278,6 +278,14 @@ class ResultGrid extends DisposableComponent {
 
     this.subscribe(this.data, this.render.bind(this));
 
+    this.subscribe(this.hasMore, val => {
+      // Hive reports hasMore = true when there's actually no more results, this prevents the grid
+      // from being grayed out after scroll as this.data doesn't change but this.hasMore does.
+      if (!val) {
+        this.showNormalResult();
+      }
+    });
+
     this.subscribe(this.meta, meta => {
       if (meta) {
         if (this.hueDatatable) {