Skip to content

Commit

Permalink
Init valtio state management (#117)
Browse files Browse the repository at this point in the history
* feat: valtio state management

* feat: using vialto for state management. Disconnect not working

* fix: types and rename clasess

* fix: requestUpdate on disconnect

* fix: typo

* fix: add usePersistence: true

* fix: remove commented code

* fix: dist instead of src

* fix: typo

* fix: using built it connection functions

* fix: tests

* fix: react not updating address
  • Loading branch information
darrenvechain authored Nov 29, 2023
1 parent 79dd9c7 commit 03c670a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/dapp-kit-ui/src/components/connect-button-with-modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ export class ConnectButtonWithModal extends LitElement {
onSourceClick = (source?: SourceInfo): void => {
if (source) {
this.wallet.setSource(source.id);
this.wallet.connect().finally(() => {
this.open = false;
});
this.wallet
.connect()
.then((res) => {
this.dappKitContext.address = res.account;
this.requestUpdate();
})
.finally(() => {
this.open = false;
});
}
};

Expand Down

0 comments on commit 03c670a

Please sign in to comment.