mirror of
https://github.com/tloncorp/landscape.git
synced 2024-12-01 10:55:45 +03:00
Merge pull request #141 from tloncorp/hm/fix-app-shortcodes
This commit is contained in:
commit
5237799258
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user