mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-26 11:21:16 +01:00
A bunch of fixes
This commit is contained in:
@@ -4,7 +4,18 @@ import { atom, useAtomValue } from 'jotai';
|
||||
export const environmentsBreakdownAtom = atom((get) => {
|
||||
const allEnvironments = get(environmentsAtom);
|
||||
const baseEnvironments = allEnvironments.filter((e) => e.parentModel === 'workspace') ?? [];
|
||||
const subEnvironments = allEnvironments.filter((e) => e.parentModel === 'environment') ?? [];
|
||||
|
||||
const subEnvironments =
|
||||
allEnvironments
|
||||
.filter((e) => e.parentModel === 'environment')
|
||||
?.sort((a, b) => {
|
||||
if (a.sortPriority === b.sortPriority) {
|
||||
return a.updatedAt > b.updatedAt ? 1 : -1;
|
||||
} else {
|
||||
return a.sortPriority - b.sortPriority;
|
||||
}
|
||||
}) ?? [];
|
||||
|
||||
const folderEnvironments =
|
||||
allEnvironments.filter((e) => e.parentModel === 'folder' && e.parentId != null) ?? [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user