[Glitch] Fix crash of standalone wrapstodon and embedded status pages
Port a78d1150a9 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
1 parent
6aca68e185
commit
81aaac4779
3 files changed
+9
-9
No files matched your search
@@ -102,15 +102,9 @@ export const FocusTargetProvider: React.FC<{
|
||||
export function useFocusOnNavigation(targetName?: string) {
|
||||
const focusTargetRef = useContext(FocusTargetContext);
|
||||
|
||||
if (focusTargetRef === null) {
|
||||
throw Error(
|
||||
'useFocusTargetContext must be used inside of a FocusTargetProvider',
|
||||
);
|
||||
}
|
||||
|
||||
return useCallback(
|
||||
(element: HTMLElement | null) => {
|
||||
const focusTarget = focusTargetRef.current;
|
||||
const focusTarget = focusTargetRef?.current;
|
||||
|
||||
// Bail out if focusTarget was set to `false`
|
||||
if (!element || !focusTarget) {
|
||||
|
||||
Reference in new issue
Block a user