mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-18 23:09:47 +02:00
Refactor desktop app into separate client and proxy apps
This commit is contained in:
9
apps/yaak-client/hooks/useActiveFolder.ts
Normal file
9
apps/yaak-client/hooks/useActiveFolder.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { foldersAtom } from '@yaakapp-internal/models';
|
||||
import { atom } from 'jotai';
|
||||
import { activeFolderIdAtom } from './useActiveFolderId';
|
||||
|
||||
export const activeFolderAtom = atom((get) => {
|
||||
const activeFolderId = get(activeFolderIdAtom);
|
||||
const folders = get(foldersAtom);
|
||||
return folders.find((r) => r.id === activeFolderId) ?? null;
|
||||
});
|
||||
Reference in New Issue
Block a user