app-search: allow distros longer than a planet

This commit is contained in:
Hunter Miller 2023-04-12 16:50:45 -05:00
parent 73d41458fa
commit 3629186677

View File

@ -58,9 +58,7 @@ export const AppSearch = React.forwardRef(
query?: string;
desk?: string;
}>(`/${menu}/:query?/(apps)?/:desk?`);
const appsMatch = useRouteMatch(
`/${menu}/${deskMatch?.params.query}/apps`
);
const appsMatch = useRouteMatch(`/${menu}/${deskMatch?.params.query}/apps`);
const inputRef = useRef<HTMLInputElement>(null);
useImperativeHandle(ref, () => inputRef.current);
const { rawInput, selectedMatch, matches, selection, select } =
@ -128,7 +126,7 @@ export const AppSearch = React.forwardRef(
const normalizedValue = input
.trim()
.replace('%', '')
.replace(/(~?[\w^_-]{3,13})\//, '$1/apps/$1/');
.replace(/(~?[\w^_-]{3,56})\//, '$1/apps/$1/');
push(`/${menu}/${normalizedValue}`);
},
[menu]