chore: clean up

This commit is contained in:
2024-01-19 07:45:28 +07:00
parent ed6423e4aa
commit 16efd495a0
23 changed files with 137 additions and 929 deletions

View File

@@ -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",

View File

@@ -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));
}
};

View File

@@ -23,7 +23,7 @@ export function AvatarUploadButton({
}
} catch (e) {
setLoading(false);
toast.error(e);
toast.error(String(e));
}
};