Skip to content

Commit

Permalink
fix: uncaught type error when not providing plugin options
Browse files Browse the repository at this point in the history
  • Loading branch information
johnson86tw committed Nov 18, 2022
1 parent 9ec5bb5 commit e9d0d2e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ type Options = {
}

export const VueDapp: Plugin = {
install(app, options: Options) {
if (options.networks) {
install(app, options?: Options) {
if (options && options.networks) {
const { availableNetworks } = useEthers()
availableNetworks.value = { ...NETWORK_DETAILS, ...options.networks }
}

app.provide('autoConnect', options.autoConnect || false)
app.provide('autoConnect', options?.autoConnect || false)

app.directive('click-outside', clickOutside)
app.component('vd-board', Board)
app.component('vd-modal', Modal)
Expand Down

0 comments on commit e9d0d2e

Please sign in to comment.