Merge pull request #141 from tloncorp/hm/fix-app-shortcodes

This commit is contained in:
james acklin 2023-04-12 18:15:36 -04:00 committed by GitHub
commit 5237799258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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]