Skip to content

Commit

Permalink
Merge pull request #590 from bitfinexcom/beta
Browse files Browse the repository at this point in the history
Release version to master
  • Loading branch information
prdn authored Dec 12, 2022
2 parents 206d663 + 05793d3 commit 4ca9981
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 23 deletions.
2 changes: 1 addition & 1 deletion bfx-report-express
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bfx-report-ui",
"version": "2.15.0",
"version": "2.16.0",
"description": "Report page to overview the user actions in Bitfinex and download related csv files",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class RegisterSubAccounts extends PureComponent {
users={users}
authData={authData}
masterAccount={masterAccEmail}
addMultipleAccsEnabled={isMultipleAccsSelected}
isMultipleAccsSelected={isMultipleAccsSelected}
/>
</>
</div>
Expand Down
11 changes: 6 additions & 5 deletions src/components/SubAccounts/SubAccount/SubAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class SubAccount extends PureComponent {
isSubAccount: PropTypes.bool,
}).isRequired,
addSubAccount: PropTypes.func.isRequired,
addMultipleAccsEnabled: PropTypes.bool,
isSubAccountsLoading: PropTypes.bool,
isMultipleAccsSelected: PropTypes.bool,
masterAccount: PropTypes.string,
updateSubAccount: PropTypes.func.isRequired,
users: PropTypes.arrayOf(PropTypes.shape({
Expand All @@ -34,7 +34,7 @@ class SubAccount extends PureComponent {
static defaultProps = {
masterAccount: undefined,
isSubAccountsLoading: false,
addMultipleAccsEnabled: true,
isMultipleAccsSelected: false,
}

state = {
Expand Down Expand Up @@ -105,7 +105,7 @@ class SubAccount extends PureComponent {
authData,
masterAccount,
isSubAccountsLoading,
addMultipleAccsEnabled,
isMultipleAccsSelected,
} = this.props
const { accounts, subUsersToRemove } = this.state
const { email: currentUserEmail, isSubAccount } = authData
Expand Down Expand Up @@ -140,9 +140,10 @@ class SubAccount extends PureComponent {
accounts={accounts}
authData={authData}
users={preparedUsers}
onChange={this.onSubUsersChange}
addMultipleAccsEnabled
masterAccount={masterAccount}
addMultipleAccsEnabled={addMultipleAccsEnabled}
onChange={this.onSubUsersChange}
shouldFilterCurrentUser={!isMultipleAccsSelected}
/>
<Button
intent={Intent.PRIMARY}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class SubUsersAdd extends PureComponent {
apiSecret: PropTypes.string,
})).isRequired,
addMultipleAccsEnabled: PropTypes.bool.isRequired,
shouldFilterCurrentUser: PropTypes.bool.isRequired,
masterAccount: PropTypes.string,
authData: PropTypes.shape({
email: PropTypes.string,
Expand Down Expand Up @@ -98,13 +99,15 @@ class SubUsersAdd extends PureComponent {
authData,
masterAccount,
addMultipleAccsEnabled,
shouldFilterCurrentUser,
} = this.props
const { email: currentUserEmail } = authData

const subAccountOptions = users.filter((account) => (
!account.isSubAccount
&& account.email !== currentUserEmail
&& account.email !== masterAccount))
&& account.email !== masterAccount
&& (shouldFilterCurrentUser ? account.email !== currentUserEmail : true)
))
const takenAccountOptions = this.getTakenAccountOptions(accounts)
const selectClassName = addMultipleAccsEnabled
? 'sub-account-create-select' : 'bitfinex-auth-email'
Expand Down
1 change: 1 addition & 0 deletions src/state/auth/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export function authReducer(state = initialState, action) {
...initialState,
...getStoredAuth(),
users: state.users,
token: state.token,
}
default:
return state
Expand Down
1 change: 1 addition & 0 deletions src/state/sync/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ export default {
WS_PROGRESS_UPDATE: 'ws_emitProgress',
WS_REQUESTS_REDIRECT: 'ws_emitRedirectingRequestsStatusToApi',
SYNC_INTERRUPTED: 'SYNCHRONIZATION_HAS_BEEN_INTERRUPTED',
SYNC_NOT_STARTED: 'SYNCHRONIZATION_HAS_NOT_STARTED_YET',
}
27 changes: 15 additions & 12 deletions src/state/sync/saga.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,26 +154,29 @@ function* initQueryMode() {
}
}

function* initSync() {
export function* initSync() {
yield call(initQueryMode)
const { result: syncProgress } = yield call(fetchSyncProgress)

const isSyncing = Number.isInteger(syncProgress) && syncProgress !== 100
if (isSyncing) {
yield put(actions.setSyncPref({
progress: syncProgress,
isSyncing: true,
}))
} else {
if (syncProgress === types.SYNC_NOT_STARTED) {
yield put(actions.setIsSyncing(false))
yield call(startSyncing)
} else {
yield put(actions.setIsSyncing(true))
const isSyncing = Number.isInteger(syncProgress) && syncProgress !== 100
if (isSyncing) {
yield put(actions.setSyncPref({
progress: syncProgress,
isSyncing: true,
}))
} else {
yield call(startSyncing)
}
yield call(getSyncConf)
}

yield call(getSyncConf)
}

function* progressUpdate({ payload }) {
const { result } = payload

if (result === types.SYNC_INTERRUPTED) {
yield put(actions.setIsSyncing(false))
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/state/ws/saga.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { call, put, takeLatest } from 'redux-saga/effects'

import { initSync } from 'state/sync/saga'
import { updateSyncStatus } from 'state/sync/actions'
import { updateStatus, updateWarningStatus } from 'state/status/actions'

Expand All @@ -8,8 +9,8 @@ import login from './signIn'

function* reconnect() {
const wsAuth = yield call(login)

if (wsAuth) {
yield call(initSync)
yield put(updateSyncStatus())
}
}
Expand Down

0 comments on commit 4ca9981

Please sign in to comment.