Sort workspaces, envs, jars

This commit is contained in:
Gregory Schier
2025-01-02 08:33:04 -08:00
parent 5ebf7dc499
commit 0dd09062e3
3 changed files with 15 additions and 3 deletions

View File

@@ -3,6 +3,10 @@ import { atom, useAtomValue } from 'jotai';
export const cookieJarsAtom = atom<CookieJar[] | undefined>();
export const sortedCookieJars = atom((get) =>
get(cookieJarsAtom)?.sort((a, b) => a.name.localeCompare(b.name)),
);
export function useCookieJars() {
return useAtomValue(cookieJarsAtom);
return useAtomValue(sortedCookieJars);
}