Skip to content

Commit

Permalink
change button
Browse files Browse the repository at this point in the history
  • Loading branch information
LukassF committed Sep 17, 2024
1 parent fb0d430 commit c398a09
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sdk/apps/modal-example/src/routes/aptos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default function AptosPage() {
const [adapter, setAdapter] = createSignal<NightlyConnectAptosAdapter>()
const [eager, setEager] = createSignal(false)
const [accountInfo, setAccountInfo] = createSignal<AccountInfo>()
const [currentNetwork, setCurrentNetwork] = createSignal<string>()

onMount(async () => {
NightlyConnectAptosAdapter.build(
Expand Down Expand Up @@ -232,15 +231,14 @@ export default function AptosPage() {
changeNetworkResponse.status === UserResponseStatus.APPROVED
) {
const changedNetwork = await adapter()!.network()
toast.success(`Changed network to ${currentNetwork}!`)
setCurrentNetwork(changedNetwork.chainId === 27 ? 'Aptos' : 'Movement')
toast.success(`Changed network!`)
}
} catch (error) {
toast.error("Couldn't change network")
console.log(error)
}
}}>
Change to {currentNetwork()}
Change network
</button>
<button
onClick={() => {
Expand Down

0 comments on commit c398a09

Please sign in to comment.