File tree Expand file tree Collapse file tree
packages/uhk-web/src/app/store/reducers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -901,6 +901,7 @@ export function reducer(
901901 case UserConfig . ActionTypes . ReorderHostConnections : {
902902 const payload = ( action as UserConfig . ReorderHostConnectionsAction ) . payload ;
903903 const userConfiguration : UserConfiguration = Object . assign ( new UserConfiguration ( ) , state . userConfiguration ) ;
904+ const processedConnectionActions = new WeakSet < ConnectionsAction > ( )
904905 userConfiguration . hostConnections = payload . map ( ( reorderedConnection , index ) => {
905906 if ( reorderedConnection . index === index ) {
906907 return reorderedConnection ;
@@ -913,9 +914,12 @@ export function reducer(
913914 layer . modules = layer . modules . map ( module => {
914915 module = Object . assign ( new Module ( ) , module ) ;
915916 module . keyActions = module . keyActions . map ( keyAction => {
916- if ( keyAction instanceof ConnectionsAction && keyAction . hostConnectionId === reorderedConnection . index ) {
917+ if ( keyAction instanceof ConnectionsAction
918+ && keyAction . hostConnectionId === reorderedConnection . index
919+ && ! processedConnectionActions . has ( keyAction ) ) {
917920 const newKeyAction = new ConnectionsAction ( keyAction ) ;
918921 newKeyAction . hostConnectionId = index ;
922+ processedConnectionActions . add ( newKeyAction ) ;
919923
920924 return newKeyAction ;
921925 }
You can’t perform that action at this time.
0 commit comments