From 2fc349a3e53888e2ae5ddf6651d1429ff836e01b Mon Sep 17 00:00:00 2001 From: Robbie Carlton Date: Wed, 17 Jul 2024 16:54:53 -0600 Subject: [PATCH] handle pubkey in agentState --- src/stores/useClientStore.js | 6 ++++++ src/utils/registration.ts | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/stores/useClientStore.js b/src/stores/useClientStore.js index ef49e30..369c998 100644 --- a/src/stores/useClientStore.js +++ b/src/stores/useClientStore.js @@ -23,6 +23,7 @@ const makeUseClientStore = ({ useInterfaceStore, onInit, fetchKycLevel }) => def // onInit is a hack, see stores/index.js for details onInit?.() + // TODO: this subscribe is getting hacky. investigate a neater way of doing this useInterfaceStore().$subscribe((_, state) => { // This could be more efficient by inspecting the contents of mutation this.isReady = state.isReady @@ -32,6 +33,11 @@ const makeUseClientStore = ({ useInterfaceStore, onInit, fetchKycLevel }) => def if (state.appInfo?.agent_pub_key) { this.agentKey = state.appInfo.agent_pub_key } + + // we override here the above here because in the holo case, agentState is in general much more up to date than appInfo + if (state.agentState?.pubkey) { + this.agentKey = state.agentState.pubkey + } }) await useInterfaceStore().initialize() diff --git a/src/utils/registration.ts b/src/utils/registration.ts index 18019ad..9d27432 100644 --- a/src/utils/registration.ts +++ b/src/utils/registration.ts @@ -51,8 +51,6 @@ export async function getBase64EncodedMembraneProof ({ throw new Error('Membrane Proof payload parsing error') } - - console.log(`^&* about to fetch registration`, membrane_proof_server_url) console.log(`^&* params`, params) console.log(`^&* JSON.stringify(params)`, JSON.stringify(params))