Skip to content

Commit

Permalink
fix: setting selectedId to null caused endless spinner [DHIS2-9337]
Browse files Browse the repository at this point in the history
Due to changes in state handling in the Dashboard component, setting selectedId to null caused an endless spinner. Also removed the 2 other redux actions because these things (clear edit dashboard and clear dashboard items) will be executed when the route is changed right after the thunk completes.
  • Loading branch information
jenniferarnesen authored Aug 28, 2020
1 parent b1805ad commit 5e899a4
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/actions/dashboards.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
import { NON_EXISTING_DASHBOARD_ID } from '../reducers/selected'
import { sGetUserUsername } from '../reducers/user'
import { tSetSelectedDashboardById, acSetSelectedId } from './selected'
import { acClearEditDashboard } from './editDashboard'
import {
apiFetchDashboards,
apiStarDashboard,
Expand Down Expand Up @@ -110,10 +109,6 @@ export const tStarDashboard = (id, isStarred) => async dispatch => {
export const tDeleteDashboard = id => async dispatch => {
try {
await apiDeleteDashboard(id)
dispatch(acClearEditDashboard())
dispatch(acSetSelectedId())
dispatch(acSetDashboardItems([]))

await dispatch(tFetchDashboards())

return Promise.resolve()
Expand Down

0 comments on commit 5e899a4

Please sign in to comment.