Browse Source

fix: show new page option when no exact match

Peng Xiao 3 years ago
parent
commit
7624f8b1cb
1 changed files with 2 additions and 2 deletions
  1. 2 2
      tldraw/apps/tldraw-logseq/src/lib/shapes/LogseqPortalShape.tsx

+ 2 - 2
tldraw/apps/tldraw-logseq/src/lib/shapes/LogseqPortalShape.tsx

@@ -373,8 +373,8 @@ export class LogseqPortalShape extends TLBoxShape<LogseqPortalShapeProps> {
         ),
       })
 
-      // New page option
-      if (searchResult?.pages?.length === 0 && q) {
+      // New page option when no exact match
+      if (!searchResult?.pages.some(p => p.toLowerCase() === q.toLowerCase()) && q) {
         options.push({
           actionIcon: 'circle-plus',
           onChosen: () => {