Skip to content

Commit

Permalink
fix: Type error and CORS error in react-app example (#258)
Browse files Browse the repository at this point in the history
* fix: Update web-did-resolver version

because the lib has bug in previous version

* fix: Type error for `getIdentityProviders`

* chore: Update lock

* fix: Change initial did of receiver

because we cannot fetch did data from `did:web:uport.me`
  • Loading branch information
winor30 committed Nov 10, 2020
1 parent d7714e5 commit 9f7dac4
Show file tree
Hide file tree
Showing 4 changed files with 279 additions and 97 deletions.
13 changes: 6 additions & 7 deletions examples/react-app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react'
import * as W3c from 'daf-w3c'
import * as TG from 'daf-trust-graph'
import * as W3c from 'daf-w3c'
import React, { useEffect, useState } from 'react'
import { agent } from './setup'
const {
BaseStyles,
Expand All @@ -26,16 +26,15 @@ declare global {
const App: React.FC = () => {
const [isSending, setIsSending] = useState(false)
const [activeDid, setActiveDid] = useState('')
const [receiver, setReceiver] = useState('did:web:uport.me')
const [receiver, setReceiver] = useState('did:web:identity.foundation')
const [claimType, setClaimType] = useState('name')
const [claimValue, setClaimValue] = useState('Alice')
const [identityProviders, setIdentityProviders] = useState([{ type: '', description: '' }])
const [identities, setIdentities] = useState([{ identityProviderType: '', did: '' }])

useEffect(() => {
agent.identityManager.getIdentityProviders().then((providers: any) => {
setIdentityProviders(providers)
})
const providers = agent.identityManager.getIdentityProviders()
setIdentityProviders(providers)
}, [])

const updateIdentityList = () => {
Expand Down Expand Up @@ -68,7 +67,7 @@ const App: React.FC = () => {
},
} as W3c.ActionSignW3cVc)

console.log(credential)
console.log('credential', credential)

// Send credential using TrustGraph
await agent.handleAction({
Expand Down
Loading

0 comments on commit 9f7dac4

Please sign in to comment.