Skip to content

Commit

Permalink
fix: The wallet may be the same before and after modification.
Browse files Browse the repository at this point in the history
  • Loading branch information
reborn-sama committed Jul 3, 2024
1 parent b5d6812 commit 2d93f5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/pages/wallet/_ChangeWallet/_StepChangeWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const StepChangeWallet = () => {
const { data: user, isGithubLogin } = useAuth();
const { address } = useAccount();
const { data: signer } = useSigner();
const userWallet = JSON.parse(localStorage.getItem("WTF_USER")).wallet;

const githubName = get(user, "user_metadata.user_name"); // TODO(chong) 待使用统一格式USER数据
const history = useHistory();
Expand Down Expand Up @@ -58,9 +59,13 @@ const StepChangeWallet = () => {

const handleOnClick = () => {
if (isGithubLogin) {
bindWalletMutate();
if (address != userWallet) {
bindWalletMutate();
} else {
toast.error("当前钱包与Github绑定的钱包一致,无需修改");
}
} else {
toast.error("Please login with Github first");
toast.error("请使用Github登录");
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/pages/wallet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function Login() {
<div className="mx-auto text-center mt-14">
<WTFLetterIcon />
<p className="text-2xl font-bold leading-8 text-content">
<Translate id="login.intro">登录 WTF 学院</Translate>
<Translate id="login.intro">换绑钱包</Translate>
</p>
<div className="px-10 py-8 mt-8 bg-white rounded-lg shadow-md dark:bg-zinc-900 w-[340px] md:min-w-[340px] md:w-auto">
{console.log("isConnected", isConnected)}
Expand Down

0 comments on commit 2d93f5b

Please sign in to comment.