Fixed dispatch bug for udapp

pull/4798/head
ioedeveloper 9 months ago
parent ad720ed7f5
commit 79a436262d
  1. 5
      libs/remix-ui/run-tab/src/lib/actions/events.ts
  2. 5
      libs/remix-ui/run-tab/src/lib/actions/index.ts

@ -12,6 +12,11 @@ import { getNetworkProxyAddresses } from "./deploy"
import { shortenAddress } from "@remix-ui/helper"
const _paq = window._paq = window._paq || []
let dispatch: React.Dispatch<any> = () => {}
export const setEventsDispatch = (reducerDispatch: React.Dispatch<any>) => {
dispatch = reducerDispatch
}
export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch<any>) => {
// This maintains current network state and update the pinned contracts list,

@ -1,7 +1,7 @@
// eslint-disable-next-line no-unused-vars
import React from 'react'
import { RunTab } from '../types/run-tab'
import { resetAndInit, setupEvents } from './events'
import { resetAndInit, setupEvents, setEventsDispatch } from './events'
import { createNewBlockchainAccount, setExecutionContext, signMessageWithAddress } from './account'
import { clearInstances, clearPopUp, removeInstance, setAccount, setGasFee, setMatchPassphrasePrompt,
setNetworkNameFromProvider, setPassphrasePrompt, setSelectedContract, setSendTransactionValue, setUnit,
@ -25,8 +25,9 @@ let plugin: RunTab, dispatch: React.Dispatch<any> = () => {}
export const initRunTab = (udapp: RunTab, resetEventsAndAccounts: boolean) => async (reducerDispatch: React.Dispatch<any>) => {
plugin = udapp
dispatch = reducerDispatch
setEventsDispatch(reducerDispatch)
if (resetEventsAndAccounts) {
setupEvents(plugin, dispatch)
setupEvents(plugin)
resetAndInit(plugin)
}
}

Loading…
Cancel
Save