mirror of
https://github.com/stablyai/orca.git
synced 2026-09-25 16:02:38 +00:00
refactor(renderer): drop the local narrowMapByKeys copy in favour of the exported one
This commit is contained in:
@@ -24,6 +24,7 @@ import type {
|
||||
import {
|
||||
captureMountedTerminalSurfaces,
|
||||
narrowedEntriesEqual,
|
||||
narrowMapByKeys,
|
||||
narrowRecordByKeys
|
||||
} from './mobile-session-capture'
|
||||
import {
|
||||
@@ -208,24 +209,6 @@ export function buildMobileSessionWorktreeInputs(
|
||||
}
|
||||
}
|
||||
|
||||
function narrowMapByKeys<T>(
|
||||
source: ReadonlyMap<string, T>,
|
||||
keys: readonly string[]
|
||||
): ReadonlyMap<string, T> {
|
||||
if (source.size === 0 || keys.length === 0) {
|
||||
return EMPTY_NARROWED_BY_KEY
|
||||
}
|
||||
let narrowed: Map<string, T> | null = null
|
||||
for (const key of keys) {
|
||||
if (!source.has(key)) {
|
||||
continue
|
||||
}
|
||||
narrowed ??= new Map<string, T>()
|
||||
narrowed.set(key, source.get(key) as T)
|
||||
}
|
||||
return narrowed ?? EMPTY_NARROWED_BY_KEY
|
||||
}
|
||||
|
||||
export function buildMobileLaunchDraftsByPaneKey(args: {
|
||||
terminalTabs: AppState['tabsByWorktree'][string]
|
||||
terminalLayoutByTabId: MobileSessionWorktreeInputs['terminalLayoutByTabId']
|
||||
|
||||
Reference in New Issue
Block a user