Skip to content

Commit

Permalink
fix #997, correct workflow ordering including when displayOrder undef…
Browse files Browse the repository at this point in the history
…ined
  • Loading branch information
JamesUoM committed Oct 4, 2023
1 parent fb79f61 commit 9e4de4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/main/WorkflowSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ const WorkflowSelection : React.FC = () => {
const dispatch = useDispatch();

// Initialite redux states
const workflows = useSelector(selectWorkflows)
let workflows = useSelector(selectWorkflows)
// Need to make copy to handle undefined displayOrder values
workflows = [...workflows].sort((a, b) => {
return (b.displayOrder - a.displayOrder)
})

const finishState = useSelector(selectFinishState)
const pageNumber = useSelector(selectPageNumber)
const theme = useTheme()
Expand Down
4 changes: 1 addition & 3 deletions src/redux/videoSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,7 @@ const videoSlice = createSlice({
state.duration = action.payload.duration
state.title = action.payload.title
state.segments = parseSegments(action.payload.segments, action.payload.duration)
state.workflows = action.payload.workflows.sort((n1: { displayOrder: number; }, n2: { displayOrder: number; }) => {
return n1.displayOrder - n2.displayOrder;
});
state.workflows = action.payload.workflows
state.waveformImages = action.payload.waveformURIs ? action.payload.waveformURIs : state.waveformImages
state.originalThumbnails = state.tracks.map((track: Track) => { return {id: track.id, uri: track.thumbnailUri} })

Expand Down

0 comments on commit 9e4de4a

Please sign in to comment.