From 51c5ffa39b974fa5ac83f08cf2cc0913f4ce58b5 Mon Sep 17 00:00:00 2001 From: Domenic Horner Date: Sun, 5 Nov 2023 00:27:35 +0800 Subject: [PATCH] fix lil bug in #32 --- package-lock.json | 4 ++-- package.json | 2 +- src/components/Header/AccountMenu.jsx | 23 ++++++++++------------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd2923f..3f52dee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lemmy-modder", - "version": "1.3.7", + "version": "1.3.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "lemmy-modder", - "version": "1.3.7", + "version": "1.3.8", "license": "MIT", "dependencies": { "@babel/core": "^7.23.2", diff --git a/package.json b/package.json index be861c7..ab02794 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lemmy-modder", - "version": "1.3.7", + "version": "1.3.8", "description": "Lemmy Moderation App", "author": "tgxn", "license": "MIT", diff --git a/src/components/Header/AccountMenu.jsx b/src/components/Header/AccountMenu.jsx index c214b63..0fc6856 100644 --- a/src/components/Header/AccountMenu.jsx +++ b/src/components/Header/AccountMenu.jsx @@ -9,6 +9,9 @@ import { Toaster, toast } from "sonner"; import Button from "@mui/joy/Button"; import Menu from "@mui/joy/Menu"; +import MenuList from "@mui/joy/MenuList"; +import MenuButton from "@mui/joy/MenuButton"; +import Dropdown from "@mui/joy/Dropdown"; import MenuItem from "@mui/joy/MenuItem"; import ListItemDecorator from "@mui/joy/ListItemDecorator"; import ListItemContent from "@mui/joy/ListItemContent"; @@ -32,7 +35,7 @@ import { setAccountIsLoading, setCurrentUser } from "../../reducers/accountReduc import { RoleIcons } from "../Shared/Icons.jsx"; -function UserListItem({ user, onClose }) { +function UserListItem({ user }) { const dispatch = useDispatch(); const queryClient = useQueryClient(); @@ -65,8 +68,6 @@ function UserListItem({ user, onClose }) { }} disabled={user.site.my_user?.local_user_view?.person.actor_id == localPerson.actor_id} onClick={async () => { - onClose(); - // delete cache for current user queryClient.invalidateQueries({ queryKey: ["lemmyHttp", localPerson.id] }); dispatch(logoutCurrent()); @@ -153,16 +154,12 @@ export default function AccountMenu() { const parsedActor = parseActorId(localPerson.actor_id); return ( - <> + - + - + {users && users.length > 0 && ( <> {users.map((user, index) => { - return ; + return ; })} )} - + ); }