diff --git a/examples/rln-js/src/app/home/components/Keystore.tsx b/examples/rln-js/src/app/home/components/Keystore.tsx index dd2841f..43237a4 100644 --- a/examples/rln-js/src/app/home/components/Keystore.tsx +++ b/examples/rln-js/src/app/home/components/Keystore.tsx @@ -1,3 +1,4 @@ +import React from "react"; import { Block, BlockTypes } from "@/components/Block"; import { Button } from "@/components/Button"; import { Status } from "@/components/Status"; @@ -5,7 +6,17 @@ import { Subtitle } from "@/components/Subtitle"; import { useStore } from "@/hooks"; export const Keystore: React.FunctionComponent<{}> = () => { - const { keystoreStatus } = useStore(); + const { keystoreStatus, keystoreCredentials } = useStore(); + + const credentialsNodes = React.useMemo( + () => + keystoreCredentials.map((v) => ( + + )), + [keystoreCredentials] + ); return ( @@ -34,15 +45,19 @@ export const Keystore: React.FunctionComponent<{}> = () => { -

Generate new credentials from wallet

+

Generate new credentials from wallet

- +

Read from Keystore

- - + + + +
); diff --git a/examples/rln-js/src/hooks/useStore.ts b/examples/rln-js/src/hooks/useStore.ts index b092ffb..b7ca404 100644 --- a/examples/rln-js/src/hooks/useStore.ts +++ b/examples/rln-js/src/hooks/useStore.ts @@ -34,7 +34,7 @@ export const useStore = create((set) => { setKeystoreStatus: (v: string) => set((state) => ({ ...state, keystoreStatus: v })), activeCredential: DEFAULT_VALUE, - keystoreCredentials: [], + keystoreCredentials: [], // ["277026D55D6F3988FB4E4695F1DCA2F59B012581A854FEE6035EE1566F898908", "59FDF2A610545099326E736269EA2E297BCA0B2BA4D68D245130BF10F9FFAC43", "FC98D3EDD1CCB2AA4C25CCDDD18ADADC8C4BBA9BA11B9F652B2E5E9732D531D3"], setActiveCredential: (v: string) => set((state) => ({ ...state, activeCredential: v })), setKeystoreCredentials: (v: string[]) => diff --git a/examples/rln-js/src/services/rln.ts b/examples/rln-js/src/services/rln.ts index bfdffc4..10f03e8 100644 --- a/examples/rln-js/src/services/rln.ts +++ b/examples/rln-js/src/services/rln.ts @@ -59,14 +59,13 @@ export class RLN implements IRLN { return; } - const rlnInstance = await this.initRLNWasm(); - await this.initRLNContract(rlnInstance); + // const rlnInstance = await this.initRLNWasm(); + // await this.initRLNContract(rlnInstance); this.emitStatusEvent(StatusEventPayload.RLN_INITIALIZED); this.initKeystore(); - // add keystore initialization this.initialized = true; }