feat: add affine global channel (#1762)

This commit is contained in:
Himself65
2023-03-30 18:21:26 -05:00
committed by GitHub
parent 3fa7d17dca
commit bb1224f9ee
38 changed files with 358 additions and 162 deletions
@@ -7,9 +7,9 @@ import {
currentWorkspaceIdAtom,
workspacesAtom,
} from '../../atoms';
import type { RemWorkspace } from '../../shared';
import type { AllWorkspace } from '../../shared';
export const currentWorkspaceAtom = atom<Promise<RemWorkspace | null>>(
export const currentWorkspaceAtom = atom<Promise<AllWorkspace | null>>(
async get => {
const id = get(currentWorkspaceIdAtom);
const workspaces = await get(workspacesAtom);
@@ -23,7 +23,7 @@ export const lastWorkspaceIdAtom = atomWithStorage<string | null>(
);
export function useCurrentWorkspace(): [
RemWorkspace | null,
AllWorkspace | null,
(id: string | null) => void
] {
const currentWorkspace = useAtomValue(currentWorkspaceAtom);