mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-21 17:09:09 +01:00
Cleanup (#148)
This commit is contained in:
@@ -2,7 +2,7 @@ import { useParams } from '@tanstack/react-router';
|
||||
import type { Workspace } from '@yaakapp-internal/models';
|
||||
import { atom, useAtomValue } from 'jotai/index';
|
||||
import { useEffect } from 'react';
|
||||
import { jotaiStore } from '../routes/__root';
|
||||
import { jotaiStore } from '../lib/jotai';
|
||||
import { useWorkspaces } from './useWorkspaces';
|
||||
|
||||
export const activeWorkspaceIdAtom = atom<string>();
|
||||
@@ -17,6 +17,10 @@ function useActiveWorkspaceId(): string | null {
|
||||
return useAtomValue(activeWorkspaceIdAtom) ?? null;
|
||||
}
|
||||
|
||||
export function getActiveWorkspaceId() {
|
||||
return jotaiStore.get(activeWorkspaceIdAtom);
|
||||
}
|
||||
|
||||
export function useSubscribeActiveWorkspaceId() {
|
||||
const { workspaceId } = useParams({ strict: false });
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user