mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
Fix hook count error
This commit is contained in:
parent
25657a548f
commit
aa1b4819bb
@ -39,14 +39,6 @@ export const UserDropdown: FC<UserDropdownProps> = ({ username: defaultUsername
|
|||||||
const [chatToggleVisible, setChatToggleVisible] = useRecoilState(chatVisibleToggleAtom);
|
const [chatToggleVisible, setChatToggleVisible] = useRecoilState(chatVisibleToggleAtom);
|
||||||
const appState = useRecoilValue<AppStateOptions>(appStateAtom);
|
const appState = useRecoilValue<AppStateOptions>(appStateAtom);
|
||||||
|
|
||||||
const currentUser = useRecoilValue(currentUserAtom);
|
|
||||||
if (!currentUser) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { displayName } = currentUser;
|
|
||||||
const username = defaultUsername || displayName;
|
|
||||||
|
|
||||||
const toggleChatVisibility = () => {
|
const toggleChatVisibility = () => {
|
||||||
setChatToggleVisible(!chatToggleVisible);
|
setChatToggleVisible(!chatToggleVisible);
|
||||||
};
|
};
|
||||||
@ -65,6 +57,13 @@ export const UserDropdown: FC<UserDropdownProps> = ({ username: defaultUsername
|
|||||||
[chatToggleVisible],
|
[chatToggleVisible],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const currentUser = useRecoilValue(currentUserAtom);
|
||||||
|
if (!currentUser) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { displayName } = currentUser;
|
||||||
|
const username = defaultUsername || displayName;
|
||||||
const menu = (
|
const menu = (
|
||||||
<Menu>
|
<Menu>
|
||||||
<Menu.Item key="0" icon={<EditOutlined />} onClick={() => handleChangeName()}>
|
<Menu.Item key="0" icon={<EditOutlined />} onClick={() => handleChangeName()}>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user