mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 16:42:19 +00:00
* improve SFTP sorting and keyboard navigation * fix SFTP keyboard actions for empty views * fix SFTP file row context menu * fix folders-first kind sorting
18 lines
583 B
TypeScript
18 lines
583 B
TypeScript
import type { SftpViewMode } from './sftpTypeahead';
|
|
|
|
export const resolveSftpActiveSelection = <T>(
|
|
viewMode: SftpViewMode,
|
|
selectedFileNames: string[],
|
|
treeSelection: T[],
|
|
): { selectedFileNames: string[]; treeSelection: T[] } => viewMode === 'list'
|
|
? { selectedFileNames, treeSelection: [] }
|
|
: { selectedFileNames: [], treeSelection };
|
|
|
|
export const resolveSftpSelectAllTarget = (
|
|
viewMode: SftpViewMode,
|
|
visibleTreeItemCount: number,
|
|
): 'list' | 'tree' | 'none' => {
|
|
if (viewMode === 'list') return 'list';
|
|
return visibleTreeItemCount > 0 ? 'tree' : 'none';
|
|
};
|