fix(core): wrong fetch injected to snapshot downloader (#9460)

This commit is contained in:
liuyi
2024-12-31 16:51:19 +08:00
committed by GitHub
parent e8aabed3fa
commit 43adb85e7d
5 changed files with 44 additions and 6 deletions

View File

@@ -206,6 +206,7 @@ const Dialog = ({
loading={disabled}
disabled={disabled}
onClick={handleImportToSelectedWorkspace}
data-testid="import-template-to-workspace-btn"
>
{selectedWorkspaceName &&
t['com.affine.import-template.dialog.createDocToWorkspace']({

View File

@@ -16,11 +16,15 @@ export const Component = () => {
const [searchParams] = useSearchParams();
const { jumpToIndex } = useNavigateHelper();
useEffect(() => {
globalDialogService.open('import-template', {
const id = globalDialogService.open('import-template', {
templateName: searchParams.get('name') ?? '',
templateMode: (searchParams.get('mode') as DocMode) ?? 'page',
snapshotUrl: searchParams.get('snapshotUrl') ?? '',
});
return () => {
globalDialogService.close(id);
};
}, [globalDialogService, jumpToIndex, searchParams]);
// no ui for this route, just open the dialog
return null;