Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sb): infinite scroll on fiat fix
- Loading branch information
Philip London
committed
Jul 17, 2020
1 parent
04efa25
commit 5e78ba8
Showing
17 changed files
with
121 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/blockchain-wallet-v4-frontend/src/data/components/fiatTransactions/actionTypes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const FIAT_TRANSACTIONS_INITIALIZED = | ||
'@EVENT.FIAT_TX.TRANSACTIONS_INITIALIZED' | ||
|
||
export const FIAT_TRANSACTIONS_LOAD_MORE = | ||
'@EVENT.FIAT_TX.TRANSACTIONS_LOAD_MORE' |
12 changes: 12 additions & 0 deletions
12
packages/blockchain-wallet-v4-frontend/src/data/components/fiatTransactions/actions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import * as AT from './actionTypes' | ||
import { FiatType } from 'core/types' | ||
|
||
export const initialized = (currency: FiatType) => ({ | ||
type: AT.FIAT_TRANSACTIONS_INITIALIZED, | ||
payload: { currency } | ||
}) | ||
|
||
export const loadMore = (currency: FiatType) => ({ | ||
type: AT.FIAT_TRANSACTIONS_LOAD_MORE, | ||
payload: { currency } | ||
}) |
18 changes: 18 additions & 0 deletions
18
packages/blockchain-wallet-v4-frontend/src/data/components/fiatTransactions/sagaRegister.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as AT from './actionTypes' | ||
import { takeEvery, takeLatest } from 'redux-saga/effects' | ||
import sagas from './sagas' | ||
|
||
export default () => { | ||
const fiatTransactionsSagas = sagas() | ||
|
||
return function * fiatTransactionsSaga () { | ||
yield takeEvery( | ||
AT.FIAT_TRANSACTIONS_INITIALIZED, | ||
fiatTransactionsSagas.initialized | ||
) | ||
yield takeLatest( | ||
AT.FIAT_TRANSACTIONS_LOAD_MORE, | ||
fiatTransactionsSagas.loadMore | ||
) | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
packages/blockchain-wallet-v4-frontend/src/data/components/fiatTransactions/sagas.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { actions } from 'data' | ||
import { put } from 'redux-saga/effects' | ||
|
||
import * as A from './actions' | ||
|
||
export const logLocation = 'components/fiatTransactions/sagas' | ||
|
||
export default () => { | ||
const initialized = function * (action: ReturnType<typeof A.initialized>) { | ||
try { | ||
yield put( | ||
actions.core.data.fiat.fetchTransactions(action.payload.currency, true) | ||
) | ||
} catch (e) { | ||
yield put(actions.logs.logErrorMessage(logLocation, 'initialized', e)) | ||
} | ||
} | ||
|
||
const loadMore = function * (action: ReturnType<typeof A.loadMore>) { | ||
try { | ||
yield put( | ||
actions.core.data.fiat.fetchTransactions(action.payload.currency) | ||
) | ||
} catch (e) { | ||
yield put(actions.logs.logErrorMessage(logLocation, 'loadMore', e)) | ||
} | ||
} | ||
return { | ||
initialized, | ||
loadMore | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
...blockchain-wallet-v4-frontend/src/scenes/Transactions/TransactionList/template.fiattx.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 2 additions & 5 deletions
7
packages/blockchain-wallet-v4/src/redux/data/algo/sagaRegister.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
import * as AT from './actionTypes' | ||
import { takeLatest } from 'redux-saga/effects' | ||
import { fork, takeLatest } from 'redux-saga/effects' | ||
import sagas from './sagas' | ||
|
||
export default ({ api }) => { | ||
const dataAlgoSagas = sagas({ api }) | ||
|
||
return function * coreDataAlgoSaga () { | ||
yield takeLatest(AT.FETCH_ALGO_RATES, dataAlgoSagas.fetchRates) | ||
yield takeLatest( | ||
AT.FETCH_ALGO_TRANSACTIONS, | ||
dataAlgoSagas.fetchTransactions | ||
) | ||
yield fork(dataAlgoSagas.watchTransactions) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 2 additions & 6 deletions
8
packages/blockchain-wallet-v4/src/redux/data/fiat/sagaRegister.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
import * as AT from './actionTypes' | ||
import { takeLatest } from 'redux-saga/effects' | ||
import { fork } from 'redux-saga/effects' | ||
import sagas from './sagas' | ||
|
||
export default ({ api }) => { | ||
const dataFiatSagas = sagas({ api }) | ||
|
||
return function * coreDataFiatSaga () { | ||
yield takeLatest( | ||
AT.FETCH_FIAT_TRANSACTIONS, | ||
dataFiatSagas.fetchTransactions | ||
) | ||
yield fork(dataFiatSagas.watchTransactions) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters