@@ -185,24 +185,8 @@ export type State = {
185185 | { status : 'error' ; error : Error }
186186 ) ;
187187
188- // Device auth flow info, stored in state so that it can be appended to the
189- // "Connecting..." modal. Only required for single connection mode and can be
190- // cleaned-up when multiple connections is the only mode of the app
191- oidcDeviceAuthInfo : Record <
192- ConnectionId ,
193- {
194- verificationUrl : string ;
195- userCode : string ;
196- }
197- > ;
198-
199188 editingConnectionInfoId : ConnectionId | null ;
200189 isEditingConnectionInfoModalOpen : boolean ;
201-
202- // State related to connection favorite fields editing modal form (right now
203- // only relevant for single connection mode, this might change)
204- editingConnectionFavoriteInfoId : ConnectionId | null ;
205- isEditingConnectionFavoriteInfoModalOpen : boolean ;
206190} ;
207191
208192type ThunkExtraArg = {
@@ -371,13 +355,6 @@ type DisconnectAction = {
371355 connectionId : ConnectionId ;
372356} ;
373357
374- type OidcNotifyDeviceAuthAction = {
375- type : ActionTypes . OidcNotifyDeviceAuth ;
376- connectionId : ConnectionId ;
377- verificationUrl : string ;
378- userCode : string ;
379- } ;
380-
381358type CreateNewConnectionAction = {
382359 type : ActionTypes . CreateNewConnection ;
383360} ;
@@ -422,11 +399,6 @@ type RemoveAllRecentConnectionsActions = {
422399 type : ActionTypes . RemoveAllRecentConnections ;
423400} ;
424401
425- type EditConnectionFavoriteInfoAction = {
426- type : ActionTypes . EditConnectionFavoriteInfo ;
427- connectionId : ConnectionId ;
428- } ;
429-
430402function isAction < A extends AnyAction > (
431403 action : AnyAction ,
432404 type : A [ 'type' ]
@@ -491,11 +463,8 @@ const INITIAL_STATE: State = {
491463 status : 'initial' ,
492464 error : null ,
493465 } ,
494- oidcDeviceAuthInfo : { } ,
495466 editingConnectionInfoId : null ,
496467 isEditingConnectionInfoModalOpen : false ,
497- editingConnectionFavoriteInfoId : null ,
498- isEditingConnectionFavoriteInfoModalOpen : false ,
499468} ;
500469
501470export function getInitialConnectionsStateForConnectionInfos (
@@ -822,10 +791,6 @@ const reducer: Reducer<State, Action> = (state = INITIAL_STATE, action) => {
822791 isAutoconnectInfo : true ,
823792 }
824793 ) ,
825- // Single connection mode special case: when autoconnecting set
826- // autoconnect info as editing so that the always-visible connection form
827- // is populated correctly and the error is mapped to it if it happend
828- editingConnectionInfoId : connectionState . info . id ,
829794 } ;
830795 }
831796 if (
@@ -834,12 +799,6 @@ const reducer: Reducer<State, Action> = (state = INITIAL_STATE, action) => {
834799 ActionTypes . ConnectionAttemptStart
835800 )
836801 ) {
837- // Clean-up existing device auth info before starting new connection so that
838- // we don't show anything until driver actually provides it. Can be removed
839- // when this state is not in the store anymore
840- const oidcDeviceAuthInfo = { ...state . oidcDeviceAuthInfo } ;
841- delete oidcDeviceAuthInfo [ action . connectionInfo . id ] ;
842-
843802 return {
844803 ...state ,
845804 connections : mergeConnectionStateById (
@@ -870,7 +829,6 @@ const reducer: Reducer<State, Action> = (state = INITIAL_STATE, action) => {
870829 error : null ,
871830 }
872831 ) ,
873- oidcDeviceAuthInfo,
874832 isEditingConnectionInfoModalOpen :
875833 // Close the modal when connection starts for edited connection
876834 state . editingConnectionInfoId === action . connectionInfo . id
@@ -943,27 +901,6 @@ const reducer: Reducer<State, Action> = (state = INITIAL_STATE, action) => {
943901 ) ,
944902 } ;
945903 }
946- if (
947- isAction < OidcNotifyDeviceAuthAction > (
948- action ,
949- ActionTypes . OidcNotifyDeviceAuth
950- )
951- ) {
952- if ( ! hasConnectionForId ( state , action . connectionId ) ) {
953- return state ;
954- }
955-
956- return {
957- ...state ,
958- oidcDeviceAuthInfo : {
959- ...state . oidcDeviceAuthInfo ,
960- [ action . connectionId ] : {
961- userCode : action . userCode ,
962- verificationUrl : action . verificationUrl ,
963- } ,
964- } ,
965- } ;
966- }
967904 if (
968905 isAction < CreateNewConnectionAction > ( action , ActionTypes . CreateNewConnection )
969906 ) {
@@ -1071,9 +1008,6 @@ const reducer: Reducer<State, Action> = (state = INITIAL_STATE, action) => {
10711008 ...( state . editingConnectionInfoId === action . connectionId && {
10721009 isEditingConnectionInfoModalOpen : false ,
10731010 } ) ,
1074- ...( state . editingConnectionFavoriteInfoId === action . connectionId && {
1075- isEditingConnectionFavoriteInfoModalOpen : false ,
1076- } ) ,
10771011 } ;
10781012 }
10791013 if (
@@ -1091,9 +1025,6 @@ const reducer: Reducer<State, Action> = (state = INITIAL_STATE, action) => {
10911025 ...( state . editingConnectionInfoId === action . connectionId && {
10921026 isEditingConnectionInfoModalOpen : false ,
10931027 } ) ,
1094- ...( state . editingConnectionFavoriteInfoId === action . connectionId && {
1095- isEditingConnectionFavoriteInfoModalOpen : false ,
1096- } ) ,
10971028 } ;
10981029 }
10991030 if (
@@ -1162,10 +1093,6 @@ const reducer: Reducer<State, Action> = (state = INITIAL_STATE, action) => {
11621093 newConnection ?. info . id ?? state . editingConnectionInfoId ,
11631094 isEditingConnectionInfoModalOpen : false ,
11641095 } ) ,
1165- ...( state . editingConnectionFavoriteInfoId === action . connectionId && {
1166- editingConnectionFavoriteInfoId : null ,
1167- isEditingConnectionFavoriteInfoModalOpen : false ,
1168- } ) ,
11691096 } ;
11701097 }
11711098 if (
@@ -1204,12 +1131,6 @@ const reducer: Reducer<State, Action> = (state = INITIAL_STATE, action) => {
12041131 return id === state . editingConnectionInfoId ;
12051132 } ) ;
12061133
1207- const isEditingFavoriteRemoveConnections =
1208- ! ! state . editingConnectionFavoriteInfoId &&
1209- idsToRemove . some ( ( id ) => {
1210- return id === state . editingConnectionFavoriteInfoId ;
1211- } ) ;
1212-
12131134 const newConnection = isEditingRemovedConnection
12141135 ? createDefaultConnectionState ( )
12151136 : undefined ;
@@ -1236,26 +1157,6 @@ const reducer: Reducer<State, Action> = (state = INITIAL_STATE, action) => {
12361157 newConnection ?. info . id ?? state . editingConnectionInfoId ,
12371158 isEditingConnectionInfoModalOpen : false ,
12381159 } ) ,
1239- ...( isEditingFavoriteRemoveConnections && {
1240- editingConnectionFavoriteInfoId : null ,
1241- isEditingConnectionFavoriteInfoModalOpen : false ,
1242- } ) ,
1243- } ;
1244- }
1245- if (
1246- isAction < EditConnectionFavoriteInfoAction > (
1247- action ,
1248- ActionTypes . EditConnectionFavoriteInfo
1249- )
1250- ) {
1251- if ( ! hasConnectionForId ( state , action . connectionId ) ) {
1252- return state ;
1253- }
1254-
1255- return {
1256- ...state ,
1257- editingConnectionFavoriteInfoId : action . connectionId ,
1258- isEditingConnectionFavoriteInfoModalOpen : true ,
12591160 } ;
12601161 }
12611162 return state ;
@@ -1467,7 +1368,6 @@ export const connect = (
14671368 | ConnectionAttemptErrorAction
14681369 | ConnectionAttemptSuccessAction
14691370 | ConnectionAttemptCancelledAction
1470- | OidcNotifyDeviceAuthAction
14711371> => {
14721372 return connectWithOptions ( connectionInfo , { forceSave : false } ) ;
14731373} ;
@@ -1480,7 +1380,6 @@ export const saveAndConnect = (
14801380 | ConnectionAttemptErrorAction
14811381 | ConnectionAttemptSuccessAction
14821382 | ConnectionAttemptCancelledAction
1483- | OidcNotifyDeviceAuthAction
14841383> => {
14851384 return connectWithOptions ( connectionInfo , { forceSave : true } ) ;
14861385} ;
@@ -1496,7 +1395,6 @@ const connectWithOptions = (
14961395 | ConnectionAttemptErrorAction
14971396 | ConnectionAttemptSuccessAction
14981397 | ConnectionAttemptCancelledAction
1499- | OidcNotifyDeviceAuthAction
15001398> => {
15011399 return async (
15021400 dispatch ,
@@ -1595,12 +1493,6 @@ const connectWithOptions = (
15951493 browserCommandForOIDCAuth,
15961494 } ,
15971495 notifyDeviceFlow : ( deviceFlowInfo ) => {
1598- dispatch ( {
1599- type : ActionTypes . OidcNotifyDeviceAuth ,
1600- connectionId : connectionInfo . id ,
1601- ...deviceFlowInfo ,
1602- } ) ;
1603-
16041496 connectionProgress . openNotifyDeviceAuthModal (
16051497 connectionInfo ,
16061498 deviceFlowInfo . verificationUrl ,
0 commit comments