Skip to content

Commit

Permalink
Merge pull request #689 from alexstotsky/fix-get-users-4-hosted
Browse files Browse the repository at this point in the history
(fix) getUsers calls for hosted version
  • Loading branch information
prdn authored Aug 14, 2023
2 parents 8c93c5f + 67cd99d commit a3651f4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/state/auth/saga.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import config from 'config'
import types from './constants'
import actions from './actions'

const { showFrameworkMode } = config

const updateAuthErrorStatus = msg => updateErrorStatus({
id: 'status.request.error',
topic: 'auth.auth',
Expand All @@ -46,7 +48,7 @@ function* onAuthSuccess(result) {
yield put(actions.updateAuth(result))
yield put(fetchSymbols())

if (config.showFrameworkMode) {
if (showFrameworkMode) {
if (!WS.isConnected) {
WS.connect()

Expand Down Expand Up @@ -103,10 +105,10 @@ function* signUp({ payload }) {
apiKey,
apiSecret,
password: isNotProtected ? undefined : password,
isNotProtected: config.showFrameworkMode ? isNotProtected : undefined,
isNotProtected: showFrameworkMode ? isNotProtected : undefined,
}

const method = config.showFrameworkMode ? 'signUp' : 'verifyUser'
const method = showFrameworkMode ? 'signUp' : 'verifyUser'
const { result, error } = yield call(makeFetchCall, method, null, authParams)

if (result) {
Expand All @@ -119,7 +121,7 @@ function* signUp({ payload }) {
}
yield put(actions.addUser(newUser))
yield put(actions.showOtpLogin(false))
yield put(actions.fetchUsers())
if (showFrameworkMode) yield put(actions.fetchUsers())
return
}

Expand All @@ -130,7 +132,7 @@ function* signUp({ payload }) {
yield put(actions.updateAuth({ authToken: '' }))
}

if (config.showFrameworkMode) {
if (showFrameworkMode) {
yield put(updateErrorStatus({
id: 'status.signUpFail',
}))
Expand Down Expand Up @@ -335,7 +337,7 @@ function* removeUser() {

function* checkAuth() {
try {
if (config.showFrameworkMode) {
if (showFrameworkMode) {
yield put(actions.fetchUsers())
}

Expand All @@ -344,7 +346,7 @@ function* checkAuth() {
return
}

if (config.showFrameworkMode) {
if (showFrameworkMode) {
yield put(actions.signIn(auth))
return
}
Expand Down

0 comments on commit a3651f4

Please sign in to comment.