mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-15 17:16:16 +08:00
refactor: move affine utils into @affine/workspace (#2611)
This commit is contained in:
@@ -6,10 +6,9 @@ import {
|
||||
setLoginStorage,
|
||||
storageChangeSlot,
|
||||
} from '@affine/workspace/affine/login';
|
||||
import { affineAuth } from '@affine/workspace/affine/shared';
|
||||
import useSWR from 'swr';
|
||||
|
||||
import { affineAuth } from '../../shared/apis';
|
||||
|
||||
const logger = new DebugLogger('auth-token');
|
||||
|
||||
const revalidate = async () => {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { Member } from '@affine/workspace/affine/api';
|
||||
import { affineApis } from '@affine/workspace/affine/shared';
|
||||
import { useCallback } from 'react';
|
||||
import useSWR from 'swr';
|
||||
|
||||
import { QueryKey } from '../../adapters/affine/fetcher';
|
||||
import { affineApis } from '../../shared/apis';
|
||||
|
||||
export function useMembers(workspaceId: string) {
|
||||
const { data, mutate } = useSWR<Member[]>(
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { affineApis } from '@affine/workspace/affine/shared';
|
||||
import { rootStore, rootWorkspacesMetadataAtom } from '@affine/workspace/atom';
|
||||
import type { AffineLegacyCloudWorkspace } from '@affine/workspace/type';
|
||||
import { useCallback } from 'react';
|
||||
import useSWR from 'swr';
|
||||
|
||||
import { QueryKey } from '../../adapters/affine/fetcher';
|
||||
import { affineApis } from '../../shared/apis';
|
||||
|
||||
export function useToggleWorkspacePublish(
|
||||
workspace: AffineLegacyCloudWorkspace
|
||||
|
||||
@@ -6,13 +6,13 @@ import {
|
||||
SignMethod,
|
||||
storageChangeSlot,
|
||||
} from '@affine/workspace/affine/login';
|
||||
import { affineAuth } from '@affine/workspace/affine/shared';
|
||||
import { rootCurrentWorkspaceIdAtom } from '@affine/workspace/atom';
|
||||
import type { WorkspaceRegistry } from '@affine/workspace/type';
|
||||
import { WorkspaceFlavour } from '@affine/workspace/type';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { affineAuth } from '../../shared/apis';
|
||||
import { useTransformWorkspace } from '../use-transform-workspace';
|
||||
|
||||
export function useOnTransformWorkspace() {
|
||||
|
||||
Reference in New Issue
Block a user