Skip to content

Commit

Permalink
fiks for #1426
Browse files Browse the repository at this point in the history
  • Loading branch information
olemp committed Jun 4, 2024
1 parent 937a1a1 commit 065c4c3
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,20 @@ export const createPortfolioAggregationReducer = (
currentView = _.find(state.views, (v) => v.id.toString() === viewIdUrlParam)
} else if (hashState.has('viewId')) {
currentView = _.find(state.views, (v) => v.id === hashState.get('viewId'))
} else if (props.dataSource || props.defaultViewId) {
} else if (props.defaultViewId) {
currentView = _.find(
state.views,
(v) => v.title === props.dataSource || v.id.toString() === props.defaultViewId?.toString()
(v) => v.id.toString() === props.defaultViewId?.toString()
)
} else if (props.dataSource) {
currentView = _.find(
state.views,
(v) => v.title === props.dataSource
)
} else {
currentView = _.find(state.views, (v) => v.isDefault)
}
if (!currentView && state.views.length > 0) {
if (!currentView && !_.isEmpty(state.views)) {
currentView = _.first(state.views)
}
if (!currentView) {
Expand Down

0 comments on commit 065c4c3

Please sign in to comment.