diff --git a/packages/core/src/controllers/ModalController.ts b/packages/core/src/controllers/ModalController.ts index c89fb00dec..6cb02f7c77 100644 --- a/packages/core/src/controllers/ModalController.ts +++ b/packages/core/src/controllers/ModalController.ts @@ -71,5 +71,6 @@ export const ModalController = { setLoading(loading: ModalControllerState['loading']) { state.loading = loading + PublicStateController.set({ loading }) } } diff --git a/packages/core/src/controllers/PublicStateController.ts b/packages/core/src/controllers/PublicStateController.ts index f4b91511a2..03f83ed2da 100644 --- a/packages/core/src/controllers/PublicStateController.ts +++ b/packages/core/src/controllers/PublicStateController.ts @@ -3,12 +3,14 @@ import type { CaipNetworkId } from '../utils/TypeUtil.js' // -- Types --------------------------------------------- // export interface PublicStateControllerState { + loading: boolean open: boolean selectedNetworkId?: CaipNetworkId } // -- State --------------------------------------------- // const state = proxy({ + loading: false, open: false, selectedNetworkId: undefined }) diff --git a/packages/scaffold/src/client.ts b/packages/scaffold/src/client.ts index 0ad3824941..1139c9f59a 100644 --- a/packages/scaffold/src/client.ts +++ b/packages/scaffold/src/client.ts @@ -118,7 +118,7 @@ export class Web3ModalScaffold { } public getState() { - return { ...PublicStateController.state } + return PublicStateController.state } public subscribeState(callback: (newState: PublicStateControllerState) => void) {