mirror of
https://github.com/Radarr/Radarr
synced 2026-01-27 09:54:27 +01:00
(cherry picked from commit e1cbc4a78249881de96160739a50c0a399ea4313) Closes #10378 Fixed: Links tooltip closing too quickly (cherry picked from commit 0b9a212f33381d07ff67e2453753aaab64cc8041) Closes #10400 Fixed: Movie links not opening on iOS (cherry picked from commit f20ac9dc348e1f5ded635f12ab925d982b1b8957) Closes #10425
36 lines
756 B
TypeScript
36 lines
756 B
TypeScript
import { createSelector } from 'reselect';
|
|
import AppState from 'App/State/AppState';
|
|
|
|
function createPathsSelector() {
|
|
return createSelector(
|
|
(state: AppState) => state.paths,
|
|
(paths) => {
|
|
const {
|
|
isFetching,
|
|
isPopulated,
|
|
error,
|
|
parent,
|
|
currentPath,
|
|
directories,
|
|
files,
|
|
} = paths;
|
|
|
|
const filteredPaths = [...directories, ...files].filter(({ path }) => {
|
|
return path.toLowerCase().startsWith(currentPath.toLowerCase());
|
|
});
|
|
|
|
return {
|
|
isFetching,
|
|
isPopulated,
|
|
error,
|
|
parent,
|
|
currentPath,
|
|
directories,
|
|
files,
|
|
paths: filteredPaths,
|
|
};
|
|
}
|
|
);
|
|
}
|
|
|
|
export default createPathsSelector;
|