Browse Source

Merge pull request #915 from gre/tradeoff-show-account-if-balance

Fix a bug in Ripple that make ops disappear after a clean
master
Gaëtan Renaudeau 7 years ago
committed by GitHub
parent
commit
4cb852a24d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      src/bridge/RippleJSBridge.js
  2. 4
      src/components/AccountPage/AccountHeaderActions.js
  3. 2
      src/components/AccountPage/index.js

12
src/bridge/RippleJSBridge.js

@ -351,7 +351,12 @@ const RippleJSBridge: WalletBridge<Transaction> = {
return unsubscribe
}),
synchronize: ({ endpointConfig, freshAddress, blockHeight }) =>
synchronize: ({
endpointConfig,
freshAddress,
blockHeight,
operations: { length: currentOpsLength },
}) =>
Observable.create(o => {
let finished = false
const unsubscribe = () => {
@ -394,7 +399,10 @@ const RippleJSBridge: WalletBridge<Transaction> = {
o.next(a => ({ ...a, balance }))
const transactions = await api.getTransactions(freshAddress, {
minLedgerVersion: Math.max(blockHeight, minLedgerVersion),
minLedgerVersion: Math.max(
currentOpsLength === 0 ? 0 : blockHeight, // if there is no ops, it might be after a clear and we prefer to pull from the oldest possible history
minLedgerVersion,
),
maxLedgerVersion,
})

4
src/components/AccountPage/AccountHeaderActions.js

@ -62,7 +62,7 @@ class AccountHeaderActions extends PureComponent<Props> {
const { account, openModal, t } = this.props
return (
<Box horizontal alignItems="center" justifyContent="flex-end" flow={2}>
{account.operations.length > 0 && (
{account.operations.length > 0 || account.balance > 0 ? (
<Fragment>
<Button small primary onClick={() => openModal(MODAL_SEND, { account })}>
<Box horizontal flow={1} alignItems="center">
@ -78,7 +78,7 @@ class AccountHeaderActions extends PureComponent<Props> {
</Box>
</Button>
</Fragment>
)}
) : null}
<Tooltip render={() => t('app:account.settings.title')}>
<ButtonSettings onClick={() => openModal(MODAL_SETTINGS_ACCOUNT, { account })}>
<Box justifyContent="center">

2
src/components/AccountPage/index.js

@ -82,7 +82,7 @@ class AccountPage extends PureComponent<Props> {
<AccountHeaderActions account={account} />
</Box>
{account.operations.length > 0 ? (
{account.operations.length > 0 || account.balance > 0 ? (
<Fragment>
<Box mb={7}>
<BalanceSummary

Loading…
Cancel
Save