@@ -12,13 +12,19 @@ interface IProps {
1212
1313const showHiddenSourceLayers = getShowHiddenSourceLayers ( )
1414
15+ export function filterSecondaryOutputLayers ( outputLayers : IOutputLayerUi [ ] ) : IOutputLayerUi [ ] {
16+ return outputLayers . filter ( ( outputLayer ) => outputLayer . used ) . sort ( ( a , b ) => a . _rank - b . _rank )
17+ }
18+
1519export function filterSecondarySourceLayers ( sourceLayers : ISourceLayerExtended [ ] ) : ISourceLayerExtended [ ] {
16- return sourceLayers . filter (
17- ( sourceLayer ) =>
18- ( showHiddenSourceLayers || ! sourceLayer . isHidden ) &&
19- ! sourceLayer . onPresenterScreen &&
20- sourceLayer . type !== SourceLayerType . TRANSITION
21- )
20+ return sourceLayers
21+ . filter (
22+ ( sourceLayer ) =>
23+ ( showHiddenSourceLayers || ! sourceLayer . isHidden ) &&
24+ ! sourceLayer . onPresenterScreen &&
25+ sourceLayer . type !== SourceLayerType . TRANSITION
26+ )
27+ . sort ( ( a , b ) => a . _rank - b . _rank )
2228}
2329
2430export const StoryboardPartSecondaryPieces = React . memo ( function StoryboardPartSecondaryPieces ( {
@@ -27,34 +33,25 @@ export const StoryboardPartSecondaryPieces = React.memo(function StoryboardPartS
2733} : IProps ) {
2834 return (
2935 < div className = "segment-storyboard__part__secondary-pieces" >
30- { Object . values < IOutputLayerUi > ( outputLayers )
31- . filter ( ( outputLayer ) => outputLayer . used )
32- . map ( ( outputLayer ) => {
33- const sourceLayers = filterSecondarySourceLayers (
34- Object . values < ISourceLayerExtended > ( outputLayer . sourceLayers )
35- )
36+ { filterSecondaryOutputLayers ( Object . values < IOutputLayerUi > ( outputLayers ) ) . map ( ( outputLayer ) => {
37+ const sourceLayers = filterSecondarySourceLayers ( Object . values < ISourceLayerExtended > ( outputLayer . sourceLayers ) )
3638
37- if ( sourceLayers . length === 0 ) return null
39+ if ( sourceLayers . length === 0 ) return null
3840
39- return (
40- < div
41- key = { outputLayer . _id }
42- className = "segment-storyboard__part__output-group"
43- data-obj-id = { outputLayer . _id }
44- role = "log"
45- aria-live = "assertive"
46- >
47- { sourceLayers . map ( ( sourceLayer ) => (
48- < StoryboardSourceLayer
49- key = { sourceLayer . _id }
50- sourceLayer = { sourceLayer }
51- pieces = { part . pieces }
52- part = { part }
53- />
54- ) ) }
55- </ div >
56- )
57- } ) }
41+ return (
42+ < div
43+ key = { outputLayer . _id }
44+ className = "segment-storyboard__part__output-group"
45+ data-obj-id = { outputLayer . _id }
46+ role = "log"
47+ aria-live = "assertive"
48+ >
49+ { sourceLayers . map ( ( sourceLayer ) => (
50+ < StoryboardSourceLayer key = { sourceLayer . _id } sourceLayer = { sourceLayer } pieces = { part . pieces } part = { part } />
51+ ) ) }
52+ </ div >
53+ )
54+ } ) }
5855 </ div >
5956 )
6057} )
0 commit comments