fix(core): add toDocSearchParams for better typeschecking doc search params (#11383)

This commit is contained in:
pengx17
2025-04-02 04:46:22 +00:00
parent 1b5df6b75e
commit 08eb248cb4
10 changed files with 41 additions and 19 deletions
@@ -7,7 +7,7 @@ import {
DocLinksService,
type Link,
} from '@affine/core/modules/doc-link';
import { toURLSearchParams } from '@affine/core/modules/navigation';
import { toDocSearchParams } from '@affine/core/modules/navigation/utils';
import { GlobalSessionStateService } from '@affine/core/modules/storage';
import { WorkbenchLink } from '@affine/core/modules/workbench';
import {
@@ -144,7 +144,7 @@ const usePreviewExtensions = () => {
const pageId = data.pageId;
if (!pageId) return <span />;
const params = toURLSearchParams(data.params);
const params = toDocSearchParams(data.params);
if (workspaceService.workspace.openOptions.isSharedMode) {
return (
@@ -18,7 +18,7 @@ import { EditorService } from '@affine/core/modules/editor';
import { EditorSettingService } from '@affine/core/modules/editor-setting';
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
import { JournalService } from '@affine/core/modules/journal';
import { toURLSearchParams } from '@affine/core/modules/navigation';
import { toDocSearchParams } from '@affine/core/modules/navigation';
import { useInsidePeekView } from '@affine/core/modules/peek-view';
import { PeekViewService } from '@affine/core/modules/peek-view/services/peek-view';
import { MemberSearchService } from '@affine/core/modules/permissions';
@@ -121,7 +121,7 @@ const usePatchSpecs = (mode: DocMode) => {
// title alias
const title = data.title;
const params = toURLSearchParams(data.params);
const params = toDocSearchParams(data.params);
if (workspaceService.workspace.openOptions.isSharedMode) {
return (