fix: revert bee env. variable names and add default rpc var (#545)

This commit is contained in:
Adam Uhlíř
2022-09-15 05:29:19 -07:00
committed by GitHub
parent 0592995564
commit 5295bd5b01
14 changed files with 59 additions and 59 deletions
+4 -4
View File
@@ -27,17 +27,17 @@ interface Props {
export function Provider({ children }: Props): ReactElement {
const [giftWallets, setGiftWallets] = useState(initialValues.giftWallets)
const { provider } = useContext(SettingsContext)
const { rpcProvider } = useContext(SettingsContext)
useEffect(() => {
if (provider === null) return
if (rpcProvider === null) return
const existingGiftWallets = localStorage.getItem(LocalStorageKeys.giftWallets)
if (existingGiftWallets) {
setGiftWallets(JSON.parse(existingGiftWallets).map((privateKey: string) => new Wallet(privateKey, provider)))
setGiftWallets(JSON.parse(existingGiftWallets).map((privateKey: string) => new Wallet(privateKey, rpcProvider)))
}
}, [provider])
}, [rpcProvider])
function addGiftWallet(wallet: Wallet) {
const newArray = [...giftWallets, wallet]