Explorar o código

[editor] Display suggestions in editor2

Properly check if a Set is empty or not.
Romain Rigaux %!s(int64=5) %!d(string=hai) anos
pai
achega
d45eba0fbf

+ 1 - 1
desktop/core/src/desktop/js/apps/notebook2/components/aceEditor/autocomplete/AutocompleteResults.ts

@@ -1886,7 +1886,7 @@ class AutocompleteResults {
         }
       });
 
-      if (!valueAttribute || Object.keys(popularityIndex).length === 0) {
+      if (!valueAttribute || popularityIndex.size === 0) {
         return [];
       }
 

+ 1 - 0
desktop/core/src/desktop/js/sql/autocompleteResults.js

@@ -2091,6 +2091,7 @@ class AutocompleteResults {
       // The columnsDeferred gets resolved synchronously when the data is cached, if not, assume there are some suggestions.
       columnSuggestions = await columnsPromise;
     } catch (err) {}
+
     if (!columnSuggestions.length) {
       return [];
     }