refactor: quick search input and result (#1512)

This commit is contained in:
JimmFly authored and GitHub committed 2023-03-10 18:00:16 +08:00
1 parent e578721cce
commit f54e0567d6
6 files changed
+146 -183

No files matched your search

@@ -1,7 +1,7 @@
import { useTranslation } from '@affine/i18n';
import type { PageBlockModel } from '@blocksuite/blocks';
import { PlusIcon } from '@blocksuite/icons';
import { assertEquals, assertExists, nanoid } from '@blocksuite/store';
import { assertEquals, nanoid } from '@blocksuite/store';
import { Command } from 'cmdk';
import { NextRouter } from 'next/router';
import React from 'react';
@@ -49,8 +49,9 @@ export const Footer: React.FC<FooterProps> = ({
const block = newPage.getBlockByFlavour(
'affine:page'
)[0] as PageBlockModel;
assertExists(block);
block.title.insert(query, 0);
if (block) {
block.title.insert(query, 0);
}
}
}}
>