fix: provider is by default null and account page redirect to provider setup (#437)
This commit is contained in:
@@ -31,7 +31,7 @@ export function GiftCardFund(): ReactElement {
|
||||
const navigate = useNavigate()
|
||||
|
||||
useEffect(() => {
|
||||
if (!privateKeyString) {
|
||||
if (!privateKeyString || !provider) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export function GiftCardFund(): ReactElement {
|
||||
}
|
||||
|
||||
async function onFund() {
|
||||
if (!wallet || !nodeAddresses) {
|
||||
if (!wallet || !nodeAddresses || !providerUrl) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ export function GiftCardTopUpIndex(): ReactElement {
|
||||
const navigate = useNavigate()
|
||||
|
||||
async function onProceed() {
|
||||
if (!provider) return
|
||||
|
||||
setLoading(true)
|
||||
try {
|
||||
const wallet = new Wallet(giftCode, provider)
|
||||
|
||||
@@ -45,7 +45,7 @@ export function Swap({ header }: Props): ReactElement {
|
||||
const bzzAfterSwap = new BzzToken(daiToSwap.toBigNumber.dividedToIntegerBy(200))
|
||||
|
||||
async function onSwap() {
|
||||
if (hasSwapped) {
|
||||
if (hasSwapped || !providerUrl) {
|
||||
return
|
||||
}
|
||||
setLoading(true)
|
||||
|
||||
Reference in New Issue
Block a user