File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
immutable_app/app/reducers Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -88,22 +88,14 @@ export default function lanes(state = initialState, action) {
8888 return state . map ( ( lane ) => {
8989 if ( lane === sourceLane ) {
9090 // get rid of the source note
91- return Map ( Object . assign ( { } , lane , {
92- notes : lane . get ( 'notes' ) . count ( ) > 1 ? List ( lane . get ( 'notes' ) . slice ( 0 , sourceNoteIndex ) . concat (
93- lane . get ( 'notes' ) . slice ( sourceNoteIndex + 1 )
94- ) ) : List ( )
95- } ) ) ;
91+ return lane . deleteIn ( [ 'notes' , sourceNoteIndex ] ) ;
9692 }
9793
9894 if ( lane === targetLane ) {
9995 // and move it to target
100- return Map ( Object . assign ( { } , lane , {
101- notes : List ( lane . get ( 'notes' ) . slice ( 0 , targetNoteIndex ) . concat (
102- [ sourceId ]
103- ) . concat (
104- lane . get ( 'notes' ) . slice ( targetNoteIndex )
105- ) )
106- } ) ) ;
96+ return lane . updateIn ( [ 'notes' ] , notes => notes . insert (
97+ targetNoteIndex , sourceId
98+ ) ) ;
10799 }
108100
109101 return lane ;
You can’t perform that action at this time.
0 commit comments