Skip to content

Commit

Permalink
EPMRPP-95440 || Code Review fix - 3
Browse files Browse the repository at this point in the history
  • Loading branch information
BlazarQSO committed Sep 25, 2024
1 parent 28fec51 commit 27d1981
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions app/src/controllers/project/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,11 @@ function* fetchProject({ payload: { projectKey, fetchInfoOnly } }) {
const project = yield call(fetch, URLS.projectByName(projectKey));
yield put(fetchProjectSuccessAction(project));
yield put(setProjectIntegrationsAction(project.integrations));
if (!fetchInfoOnly) {

const userRoles = yield select(userRolesSelector);
const hasFilterPermissions = canWorkWithFilters(userRoles);

if (!fetchInfoOnly && hasFilterPermissions) {
yield put(fetchProjectPreferencesAction(project.projectKey));
}
} catch (error) {
Expand All @@ -432,15 +436,9 @@ function* watchFetchProject() {
}

function* fetchProjectPreferences({ payload: projectKey }) {
const userRoles = yield select(userRolesSelector);
const hasFilterPermissions = canWorkWithFilters(userRoles);

const preferences = yield call(fetch, URLS.projectPreferences(projectKey));
yield put(fetchProjectPreferencesSuccessAction(preferences));

if (hasFilterPermissions) {
yield put(fetchUserFiltersSuccessAction(preferences.filters));
}
yield put(fetchUserFiltersSuccessAction(preferences.filters));
}

function* watchFetchProjectPreferences() {
Expand Down

0 comments on commit 27d1981

Please sign in to comment.