Skip to content

Commit

Permalink
feat(dcellar-web-ui): update walletkit
Browse files Browse the repository at this point in the history
  • Loading branch information
aiden-cao committed Nov 15, 2023
1 parent 6afb5e8 commit a6ff456
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/dcellar-web-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@next/bundle-analyzer": "^13.1.6",
"@totejs/icons": "^2.17.0",
"@totejs/uikit": "~2.54.1",
"@totejs/walletkit": "0.2.1",
"@totejs/walletkit": "0.2.4",
"axios": "^1.3.2",
"axios-retry": "^3.4.0",
"bignumber.js": "^9.1.1",
Expand Down
4 changes: 3 additions & 1 deletion apps/dcellar-web-ui/src/components/ConnectWallet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface ConnectWalletProps extends DCButtonProps {
let eventTriggerTime = Date.now();

export const ConnectWallet = memo<Partial<ConnectWalletProps>>(function ConnectButton(props) {
const { onOpen } = useModal();
const { onOpen, onClose } = useModal();
const router = useRouter();
const dispatch = useAppDispatch();
const { connector, address, isConnected } = useAccount();
Expand All @@ -47,12 +47,14 @@ export const ConnectWallet = memo<Partial<ConnectWalletProps>>(function ConnectB

if (!isAvailable) {
const res = await onOffChainAuth(address);
onClose();
if (res.code !== 0) {
disconnect();
return;
}
dispatch(setLogin(address));
} else {
onClose();
dispatch(setLogin(address));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const client = createClient(

const options: WalletKitOptions = {
initialChainId: GREENFIELD_CHAIN_ID,
closeModalAfterConnected: false,
closeModalOnEsc: false,
closeModalOnOverlayClick: false,
disclaimer: (
<Text>
By connecting your wallet, you agree to our{' '}
Expand Down
8 changes: 4 additions & 4 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a6ff456

Please sign in to comment.