Files
cinny/src/app/hooks/router/useExploreSelected.ts
Max Litruv Boonzaayer b4258278d8 fix: restore rooms and DMs after React Router 7 upgrade
Stop double-encoding Matrix IDs in pathUtils, decode route params on read, fix millify CJS import, and read space children from currentState so channels and joins work again.
2026-07-09 02:35:04 +10:00

29 lines
656 B
TypeScript

import { useMatch, useParams } from 'react-router-dom';
import { decodeRouteParam, getExploreFeaturedPath, getExplorePath } from '../../pages/pathUtils';
export const useExploreSelected = (): boolean => {
const match = useMatch({
path: getExplorePath(),
caseSensitive: true,
end: false,
});
return !!match;
};
export const useExploreFeaturedSelected = (): boolean => {
const match = useMatch({
path: getExploreFeaturedPath(),
caseSensitive: true,
end: false,
});
return !!match;
};
export const useExploreServer = (): string | undefined => {
const { server } = useParams();
return decodeRouteParam(server);
};