Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/test/vault/rebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe("Vault rebase pausing", async () => {
);
});

it("Should allow governor tonpause rebasing", async () => {
it("Should allow governor to pause rebasing", async () => {
let { vault, governor } = await loadFixture(defaultFixture);
await vault.connect(governor).pauseRebase();
});
Expand Down
3 changes: 3 additions & 0 deletions dapp/src/components/AccountListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ const AccountListener = (props) => {
s.allowances = {}
s.balances = {}
})
ContractStore.update((s) => {
s.walletConnected = false
})
PoolStore.update((s) => {
s.claimable_ogn = null
s.lp_tokens = null
Expand Down
4 changes: 3 additions & 1 deletion dapp/src/components/buySell/BalanceHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ const BalanceHeader = ({
<Statistic
title={fbt('Balance', 'OUSD Balance')}
value={
!isNaN(parseFloat(displayedBalance)) && ousdBalanceLoaded
walletConnected &&
!isNaN(parseFloat(displayedBalance)) &&
ousdBalanceLoaded
? displayedBalance
: '--.--'
}
Expand Down
4 changes: 3 additions & 1 deletion dapp/src/components/wrap/BalanceHeaderWrapped.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ const BalanceHeaderWrapped = ({
<Statistic
title={fbt('wOUSD Balance', 'wOUSD Balance')}
value={
!isNaN(parseFloat(displayedWousdBalance)) && wousdBalanceLoaded
walletConnected &&
!isNaN(parseFloat(displayedWousdBalance)) &&
wousdBalanceLoaded
? displayedWousdBalance
: '--.--'
}
Expand Down
2 changes: 1 addition & 1 deletion dapp/src/services/apy.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class ApyService {
throw new Error(`Unexpected days param: ${days}`)
}
const response = await fetch(endpoint)
if (!response.ok) {
if (!response || !response.ok) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Could use the shorthand !response?.ok

throw new Error(`Failed to fetch ${days} day APY`, err)
}
const json = await response.json()
Expand Down
2 changes: 1 addition & 1 deletion dapp/src/services/balances.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class BalancesService {
body: JSON.stringify(data),
})

if (!response.ok) {
if (!response || !response.ok) {
throw new Error(
`Could not fetch balances from Alchemy http status: ${response.status}`
)
Expand Down
2 changes: 1 addition & 1 deletion dapp/src/services/transaction-history-page.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class TransactionHistoryPageService {
}/${account.toLowerCase()}/history?per_page=${transactionHistoryItemsPerPage}&page=${page}${filter_param}`
)

if (!response.ok) {
if (!response || !response.ok) {
throw new Error('Failed fetching history from analytics')
}

Expand Down
2 changes: 1 addition & 1 deletion dapp/src/services/transaction-history.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class TransactionHistoryService {
this.baseURL
}/${account.toLowerCase()}/history?per_page=1000000${filter_param}`
)
if (!response.ok) {
if (!response || !response.ok) {
throw new Error('Failed fetching history from analytics')
}

Expand Down
3 changes: 3 additions & 0 deletions dapp/src/utils/contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ export async function setupContracts(account, library, chainId, fetchId) {

const fetchCreditsPerToken = async () => {
try {
if (!walletConnected) {
return
}
const response = await fetch(process.env.CREDITS_ANALYTICS_ENDPOINT)
if (response.ok) {
const json = await response.json()
Expand Down