fix wrongly patching 'Events' context menu

This commit is contained in:
Vendicated 2024-01-05 23:31:09 +01:00
parent 3eada99ad6
commit 4d198e46bc
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
2 changed files with 3 additions and 1 deletions

View file

@ -82,7 +82,7 @@ export const streamContextPatch: NavContextMenuPatchCallback = (children, { stre
}; };
export const userContextPatch: NavContextMenuPatchCallback = (children, { user }: UserContextProps) => { export const userContextPatch: NavContextMenuPatchCallback = (children, { user }: UserContextProps) => {
return addViewStreamContext(children, { userId: user.id }); if (user) return addViewStreamContext(children, { userId: user.id });
}; };
export default definePlugin({ export default definePlugin({

View file

@ -30,6 +30,8 @@ interface UserContextProps {
} }
const UserContextMenuPatch: NavContextMenuPatchCallback = (children, { user }: UserContextProps) => () => { const UserContextMenuPatch: NavContextMenuPatchCallback = (children, { user }: UserContextProps) => () => {
if (!user) return;
children.push( children.push(
<Menu.MenuItem <Menu.MenuItem
id="vc-copy-user-url" id="vc-copy-user-url"