From 59b6be25b1444b738f5f532ede28f080579bec71 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Thu, 4 Aug 2022 16:54:21 +0800 Subject: [PATCH] fix(gui-v2): init trie in AC tree --- packages/nc-gui-v2/utils/NcAutocompleteTree.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nc-gui-v2/utils/NcAutocompleteTree.ts b/packages/nc-gui-v2/utils/NcAutocompleteTree.ts index 8af01f9812..eee03ecb1e 100644 --- a/packages/nc-gui-v2/utils/NcAutocompleteTree.ts +++ b/packages/nc-gui-v2/utils/NcAutocompleteTree.ts @@ -24,7 +24,7 @@ export class NcAutocompleteTree { } add(word: Record) { - if (!this.trie) { + if (Object.keys(this.trie).length === 0) { this.trie = this.newNode() }