mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-26 11:21:16 +01:00
Sort workspaces, envs, jars
This commit is contained in:
@@ -5,6 +5,10 @@ import { listWorkspaces } from '../lib/store';
|
||||
const workspaces = await listWorkspaces();
|
||||
export const workspacesAtom = atom<Workspace[]>(workspaces);
|
||||
|
||||
export const sortedWorkspacesAtom = atom((get) =>
|
||||
get(workspacesAtom).sort((a, b) => a.name.localeCompare(b.name)),
|
||||
);
|
||||
|
||||
export function useWorkspaces() {
|
||||
return useAtomValue(workspacesAtom);
|
||||
return useAtomValue(sortedWorkspacesAtom);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user