Skip to content

Commit

Permalink
update: add conditional for wc and discovery api
Browse files Browse the repository at this point in the history
  • Loading branch information
gregsantos committed Oct 24, 2022
1 parent bc77a3b commit 99e35e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions flow/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ if (USE_LOCAL) {
.put("flow.network", "local")
.put("accessNode.api", "http://localhost:8888")
// dev-wallet
// .put("discovery.wallet", "http://localhost:8701/fcl/authn")
// local discovery
.put("discovery.wallet", "http://localhost:3002/local/authn")
.put("discovery.authn.endpoint", "http://localhost:3002/api/local/authn")
.put("discovery.wallet", "http://localhost:8701/fcl/authn")
// local discovery
// .put("discovery.wallet", "http://localhost:3002/local/authn")
// .put("discovery.authn.endpoint", "http://localhost:3002/api/local/authn")
} else {
// prettier-ignore
fcl
Expand Down
10 changes: 7 additions & 3 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,20 @@ export default function Home() {
})
fcl.pluginRegistry.add(FclWcServicePlugin)
}
if (process.env.NEXT_PUBLIC_WC_PROJECT_ID) initAdapter()
if (
config &&
config.flow.network !== "local" &&
process.env.NEXT_PUBLIC_WC_PROJECT_ID
)
initAdapter()
}, [])

useEffect(() => {
const fetchServices = async () =>
await fcl.discovery.authn.subscribe(res => {
console.log("discovery api services", res)
setServices(res.results)
})
fetchServices()
if (config && config.discovery.authn.endpoint) fetchServices()
}, [])

useEffect(() => {
Expand Down

1 comment on commit 99e35e3

@vercel
Copy link

@vercel vercel bot commented on 99e35e3 Oct 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.