chore: clean up
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
"react-dom": "^18.2.0",
|
||||
"react-hook-form": "^7.49.3",
|
||||
"react-hotkeys-hook": "^4.4.4",
|
||||
"react-router-dom": "^6.21.2",
|
||||
"react-router-dom": "^6.21.3",
|
||||
"slate": "^0.101.5",
|
||||
"slate-react": "^0.101.5",
|
||||
"sonner": "^1.3.1",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useArk } from "@lume/ark";
|
||||
import { LogoutIcon } from "@lume/icons";
|
||||
import { useStorage } from "@lume/storage";
|
||||
import * as AlertDialog from "@radix-ui/react-alert-dialog";
|
||||
@@ -6,10 +7,10 @@ import { useNavigate } from "react-router-dom";
|
||||
import { toast } from "sonner";
|
||||
|
||||
export function Logout() {
|
||||
const ark = useArk();
|
||||
const storage = useStorage();
|
||||
|
||||
const navigate = useNavigate();
|
||||
const queryClient = useQueryClient();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const logout = async () => {
|
||||
try {
|
||||
@@ -18,11 +19,14 @@ export function Logout() {
|
||||
|
||||
// clear cache
|
||||
queryClient.clear();
|
||||
ark.account = null;
|
||||
ark.ndk.signer = null;
|
||||
ark.ndk.activeUser = null;
|
||||
|
||||
// redirect to welcome screen
|
||||
navigate("/auth/welcome");
|
||||
navigate("/auth/");
|
||||
} catch (e) {
|
||||
toast.error(e);
|
||||
toast.error(String(e));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export function AvatarUploadButton({
|
||||
}
|
||||
} catch (e) {
|
||||
setLoading(false);
|
||||
toast.error(e);
|
||||
toast.error(String(e));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user