mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-30 13:39:52 +00:00
fix(app): permission indicator
This commit is contained in:
parent
e9a7c71141
commit
b0b88f6792
3 changed files with 52 additions and 12 deletions
|
|
@ -33,6 +33,13 @@ export const latestRootSession = (stores: { session: Session[]; path: { director
|
|||
.flatMap((store) => store.session.filter((session) => isRootVisibleSession(session, store.path.directory)))
|
||||
.sort(sortSessions(now))[0]
|
||||
|
||||
export function hasProjectPermissions<T>(
|
||||
request: Record<string, T[] | undefined>,
|
||||
include: (item: T) => boolean = () => true,
|
||||
) {
|
||||
return Object.values(request).some((list) => list?.some(include))
|
||||
}
|
||||
|
||||
export const childMapByParent = (sessions: Session[]) => {
|
||||
const map = new Map<string, string[]>()
|
||||
for (const session of sessions) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue