Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A-1207533924069436 #163

Merged
merged 7 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions src/components/containers/Wallet/ShowAddress.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const _data = {
address: '2MyEpfT2SxQjVRipzTEzxSRPyerpoENmAom',
onCopy: jest.fn(),
linearQr:
'0000000101111001011011000000001111101011000001000110111110010001010011010110101101000100100010100010111000101010001001000101100101111110110100010011111010001111101000101111100000000101010101010101000000011111111110010101011111111111001100011101001010111110100001011011001111000001110100101100100001100111101011110000110010111111011010110001010001101100100011101000101110111111000011110100101100101101000000011010000110000010010001111100000011010101010000100101011001100100110100111010001000100010101100111100101101100010111111010001111110111110101101011110111100101001011010000101000111001000100010100000010111111111100010110011101110100000000001111000000011010101100011111010000101110100111011110100010101010010101000000111101000101100110010000101010010010001011011111011010111110000111110100010100100000010010000000001000010011111011101001',
'10',
}

const setup = ({ data = _data } = {}) => {
Expand Down Expand Up @@ -42,7 +42,7 @@ test('Renders ShowAddress page', () => {
test('Renders ShowAddress qrcode in svg', async () => {
const { qrcode } = setup()

expect(qrcode.childElementCount).toBe(841)
expect(qrcode.childElementCount).toBe(2)

const { children } = qrcode

Expand Down
14 changes: 7 additions & 7 deletions src/contexts/NetworkProvider/NetworkProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,16 @@ const NetworkProvider = ({ value: propValue, children }) => {
...currentMlAddresses.mlChangeAddresses,
]
: []
owlsua marked this conversation as resolved.
Show resolved Hide resolved
const addresses_data_receive = await Promise.all(
const addresses_data_receive = currentMlAddresses ? await Promise.all(
currentMlAddresses.mlReceivingAddresses.map((address) =>
getAddressData(address),
),
)
const addresses_data_change = await Promise.all(
) : []
const addresses_data_change = currentMlAddresses ? await Promise.all(
currentMlAddresses.mlChangeAddresses.map((address) =>
getAddressData(address),
),
)
) : []
const addresses_data = [...addresses_data_receive, ...addresses_data_change]

const first_unused_change_address_index = addresses_data_change.findIndex(
Expand All @@ -94,7 +94,7 @@ const NetworkProvider = ({ value: propValue, children }) => {
)

const first_unused_change_address =
currentMlAddresses.mlChangeAddresses[first_unused_change_address_index]
currentMlAddresses && currentMlAddresses.mlChangeAddresses[first_unused_change_address_index]

const first_unused_receive_address_index = addresses_data_receive.findIndex(
(address_data) => {
Expand All @@ -104,7 +104,7 @@ const NetworkProvider = ({ value: propValue, children }) => {
)

const first_unused_receive_address =
currentMlAddresses.mlReceivingAddresses[
currentMlAddresses && currentMlAddresses.mlReceivingAddresses[
first_unused_receive_address_index
]

Expand Down Expand Up @@ -147,7 +147,7 @@ const NetworkProvider = ({ value: propValue, children }) => {
setFetchingTransactions(false)

// fetch utxos
const accountName = account.name
const accountName = account && account.name
const unconfirmedTransactionString = `${AppInfo.UNCONFIRMED_TRANSACTION_NAME}_${accountName}_${networkType}`
const unconfirmedTransactions =
LocalStorageService.getItem(unconfirmedTransactionString) || []
Expand Down