Files
sencho/frontend/src/components/EditorLayout/hooks/resolveStackFileKey.ts
T
Anso 5d89a10754 fix(ui): show delayed busy feedback on confirm actions (#1763)
Wire ConfirmModal and BusyButton so async confirms lock immediately, show
spinner and progressive labels after duration-base, and block dismiss mid-flight.
Connect stack delete and take-down to the existing stackAction map so the dialog
is not idle until the toast.
2026-08-03 22:14:24 -04:00

13 lines
409 B
TypeScript

/**
* Map an overlay stack name (bare name or filename) to the key used in
* `stackActionMap` / stack file lists. The map is filename-keyed (e.g. `web.yml`);
* overlay state often holds the bare name (`web`).
*/
export function resolveStackFileKey(files: string[], name: string): string {
return (
files.find(
(f) => f === name || f.replace(/\.(yml|yaml)$/, '') === name,
) ?? name
);
}