Skip to content

Commit

Permalink
fix: clear current also on missing TET error
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardo committed Nov 27, 2023
1 parent 2c6f517 commit 971b15a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/actions/current.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { genericClientError } from '../modules/error.js'
import {
layoutHasProgramId,
layoutHasTrackedEntityTypeId,
validateLayout,
} from '../modules/layoutValidation.js'
import { OUTPUT_TYPE_TRACKED_ENTITY } from '../modules/visualization.js'

Check failure on line 7 in src/actions/current.js

View workflow job for this annotation

GitHub Actions / lint

'OUTPUT_TYPE_TRACKED_ENTITY' is defined but never used
Expand Down Expand Up @@ -53,12 +54,12 @@ export const tSetCurrentFromUi =

if (!validateOnly) {
if (
currentFromUi.outputType !== OUTPUT_TYPE_TRACKED_ENTITY &&
!layoutHasProgramId(currentFromUi)
layoutHasProgramId(currentFromUi) ||
layoutHasTrackedEntityTypeId(currentFromUi)
) {
dispatch(acClearCurrent())
} else {
dispatch(acSetCurrent(currentFromUi))
} else {
dispatch(acClearCurrent())
}

dispatch(acSetShowExpandedLayoutPanel(false))
Expand Down

0 comments on commit 971b15a

Please sign in to comment.