fix(core): should open a new tab with parameters (#8118)

Closes [AF-1343](https://linear.app/affine-design/issue/AF-1343/点击-center-peek-右侧的按钮时,应该携带参数)
This commit is contained in:
fundon
2024-09-05 10:30:39 +00:00
parent 7621758c76
commit de1a51bf7c
4 changed files with 35 additions and 17 deletions

View File

@@ -54,10 +54,14 @@ export class CMDKQuickSearchService extends Service {
result.source === 'docs' &&
track.$.cmdk.results.searchResultsDocs();
this.workbenchService.workbench.openDoc({
const options: { docId: string; blockIds?: string[] } = {
docId: doc.docId,
blockId: doc.blockId,
});
};
if (doc.blockId) {
options.blockIds = [doc.blockId];
}
this.workbenchService.workbench.openDoc(options);
} else if (result.source === 'collections') {
this.workbenchService.workbench.openCollection(
result.payload.collectionId