mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 09:08:32 +02:00
Clean up model fetching and loading states
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { CookieJar } from '@yaakapp-internal/models';
|
||||
import { atom, useAtomValue } from 'jotai';
|
||||
import { jotaiStore } from '../lib/jotai';
|
||||
|
||||
export const cookieJarsAtom = atom<CookieJar[] | undefined>();
|
||||
|
||||
@@ -10,3 +11,7 @@ export const sortedCookieJars = atom((get) => {
|
||||
export function useCookieJars() {
|
||||
return useAtomValue(sortedCookieJars);
|
||||
}
|
||||
|
||||
export function getCookieJar(id: string | null) {
|
||||
return jotaiStore.get(cookieJarsAtom)?.find((e) => e.id === id) ?? null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user