mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-17 22:37:04 +08:00
refactor: ui adapter (#2577)
This commit is contained in:
@@ -18,7 +18,7 @@ import { createDynamicRouteParser } from 'next-router-mock/dynamic-routes';
|
||||
import type { FC, PropsWithChildren } from 'react';
|
||||
import { beforeAll, beforeEach, describe, expect, test, vi } from 'vitest';
|
||||
|
||||
import { LocalPlugin } from '../../adapters/local';
|
||||
import { LocalAdapter } from '../../adapters/local';
|
||||
import { workspacesAtom } from '../../atoms';
|
||||
import { BlockSuiteWorkspace } from '../../shared';
|
||||
import { WorkspaceSubPath } from '../../shared';
|
||||
@@ -92,7 +92,7 @@ describe('useRecentlyViewed', () => {
|
||||
flavour: WorkspaceFlavour.LOCAL,
|
||||
},
|
||||
]);
|
||||
LocalPlugin.CRUD.get = vi.fn().mockResolvedValue({
|
||||
LocalAdapter.CRUD.get = vi.fn().mockResolvedValue({
|
||||
id: workspaceId,
|
||||
flavour: WorkspaceFlavour.LOCAL,
|
||||
blockSuiteWorkspace,
|
||||
|
||||
@@ -8,7 +8,7 @@ import { nanoid } from '@blocksuite/store';
|
||||
import { useAtomValue, useSetAtom } from 'jotai';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { LocalPlugin } from '../adapters/local';
|
||||
import { LocalAdapter } from '../adapters/local';
|
||||
import { WorkspaceAdapters } from '../adapters/workspace';
|
||||
import { workspacesAtom } from '../atoms';
|
||||
import type { AllWorkspace } from '../shared';
|
||||
@@ -62,7 +62,7 @@ export function useAppHelper() {
|
||||
WorkspaceFlavour.LOCAL
|
||||
);
|
||||
blockSuiteWorkspace.meta.setName(name);
|
||||
const id = await LocalPlugin.CRUD.create(blockSuiteWorkspace);
|
||||
const id = await LocalAdapter.CRUD.create(blockSuiteWorkspace);
|
||||
set(workspaces => [
|
||||
...workspaces,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user