Files
kandev/apps/web/components/task/task-switcher-context-menu-helpers.ts

12 lines
308 B
TypeScript

export function clearSelectionBeforeAction(
actingOnSelection: boolean,
onClearSelection: (() => void) | undefined,
handler?: (id: string) => void,
) {
if (!actingOnSelection || !onClearSelection || !handler) return handler;
return (id: string) => {
onClearSelection();
handler(id);
};
}