Skip to content

Commit

Permalink
force disconnect of original account
Browse files Browse the repository at this point in the history
  • Loading branch information
starknetdev committed Oct 13, 2023
1 parent 1cf7186 commit c0537bc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ui/src/app/components/ArcadeDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const ArcadeDialog = () => {
const showArcadeDialog = useUIStore((state) => state.showArcadeDialog);
const arcadeDialog = useUIStore((state) => state.arcadeDialog);
const isWrongNetwork = useUIStore((state) => state.isWrongNetwork);
const { connect, connectors, available } = useConnectors();
const { connect, disconnect, connectors, available } = useConnectors();
const {
getMasterAccount,
create,
Expand Down Expand Up @@ -149,6 +149,7 @@ export const ArcadeDialog = () => {
key={index}
account={account}
onClick={connect}
disconnect={disconnect}
address={address!}
walletAccount={walletAccount!}
masterAccountAddress={masterAccount}
Expand Down Expand Up @@ -231,6 +232,7 @@ export const ArcadeDialog = () => {
interface ArcadeAccountCardProps {
account: Connector;
onClick: (conn: Connector<any>) => void;
disconnect: () => void;
address: string;
walletAccount: AccountInterface;
masterAccountAddress: string;
Expand Down Expand Up @@ -259,6 +261,7 @@ interface ArcadeAccountCardProps {
export const ArcadeAccountCard = ({
account,
onClick,
disconnect,
address,
walletAccount,
masterAccountAddress,
Expand Down Expand Up @@ -321,7 +324,10 @@ export const ArcadeAccountCard = ({
<div className="flex flex-row">
<Button
variant={connected ? "default" : "ghost"}
onClick={() => onClick(account)}
onClick={() => {
disconnect();
onClick(account);
}}
>
{connected ? "connected" : "connect"}
</Button>
Expand Down

1 comment on commit c0537bc

@vercel
Copy link

@vercel vercel bot commented on c0537bc Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.