@@ -1,3 +1,4 @@
|
|||||||
|
import { LoadingIcon } from '@affine/core/blocksuite/presets/blocks/_common/icon';
|
||||||
import { fuzzyMatch } from '@affine/core/utils/fuzzy-match';
|
import { fuzzyMatch } from '@affine/core/utils/fuzzy-match';
|
||||||
import { I18n, i18nTime } from '@affine/i18n';
|
import { I18n, i18nTime } from '@affine/i18n';
|
||||||
import track from '@affine/track';
|
import track from '@affine/track';
|
||||||
@@ -123,6 +124,30 @@ export class AtMenuConfigService extends Service {
|
|||||||
const showRecent = query.trim().length === 0;
|
const showRecent = query.trim().length === 0;
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
|
const isIndexerLoading =
|
||||||
|
this.docsSearch.indexer.status$.value.remaining !== undefined &&
|
||||||
|
this.docsSearch.indexer.status$.value.remaining > 0;
|
||||||
|
|
||||||
|
if (!showRecent && isIndexerLoading) {
|
||||||
|
// add a loading item
|
||||||
|
docItems.value = [
|
||||||
|
{
|
||||||
|
key: 'loading',
|
||||||
|
name: I18n.t('com.affine.editor.at-menu.loading'),
|
||||||
|
icon: LoadingIcon,
|
||||||
|
action: () => {
|
||||||
|
// no action
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
// wait for indexer to finish
|
||||||
|
await this.docsSearch.indexer.status$.waitFor(
|
||||||
|
status => status.remaining === 0
|
||||||
|
);
|
||||||
|
// remove the loading item
|
||||||
|
docItems.value = [];
|
||||||
|
}
|
||||||
|
|
||||||
const docMetas = (
|
const docMetas = (
|
||||||
showRecent
|
showRecent
|
||||||
? this.recentDocsService.getRecentDocs()
|
? this.recentDocsService.getRecentDocs()
|
||||||
|
|||||||
@@ -6299,6 +6299,10 @@ export function useAFFiNEI18N(): {
|
|||||||
* `Recent`
|
* `Recent`
|
||||||
*/
|
*/
|
||||||
["com.affine.editor.at-menu.recent-docs"](): string;
|
["com.affine.editor.at-menu.recent-docs"](): string;
|
||||||
|
/**
|
||||||
|
* `Loading...`
|
||||||
|
*/
|
||||||
|
["com.affine.editor.at-menu.recent-docs.loading"](): string;
|
||||||
/**
|
/**
|
||||||
* `New`
|
* `New`
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1572,6 +1572,7 @@
|
|||||||
"com.affine.editor.journal-conflict.title": "Duplicate Entries in Today's Journal",
|
"com.affine.editor.journal-conflict.title": "Duplicate Entries in Today's Journal",
|
||||||
"com.affine.editor.at-menu.link-to-doc": "Search for \"{{query}}\"",
|
"com.affine.editor.at-menu.link-to-doc": "Search for \"{{query}}\"",
|
||||||
"com.affine.editor.at-menu.recent-docs": "Recent",
|
"com.affine.editor.at-menu.recent-docs": "Recent",
|
||||||
|
"com.affine.editor.at-menu.loading": "Loading...",
|
||||||
"com.affine.editor.at-menu.new-doc": "New",
|
"com.affine.editor.at-menu.new-doc": "New",
|
||||||
"com.affine.editor.at-menu.create-page": "New \"{{name}}\" page",
|
"com.affine.editor.at-menu.create-page": "New \"{{name}}\" page",
|
||||||
"com.affine.editor.at-menu.create-edgeless": "New \"{{name}}\" edgeless",
|
"com.affine.editor.at-menu.create-edgeless": "New \"{{name}}\" edgeless",
|
||||||
|
|||||||
Reference in New Issue
Block a user