@@ -61,6 +61,7 @@ impl<F: FlowController + Send> ViewModel<F> {
6161 } = request. requesting_app ;
6262
6363 let app_name: Option < String > = app_name. into ( ) ;
64+ let devices = request. initial_devices ;
6465 Self {
6566 flow_controller,
6667 rx_event,
@@ -72,7 +73,7 @@ impl<F: FlowController + Send> ViewModel<F> {
7273 app_pid : pid,
7374 title : String :: default ( ) ,
7475 subtitle : String :: default ( ) ,
75- devices : Vec :: new ( ) ,
76+ devices,
7677 selected_device : None ,
7778 hybrid_qr_state : HybridState :: default ( ) ,
7879 hybrid_qr_code_data : None ,
@@ -125,14 +126,7 @@ impl<F: FlowController + Send> ViewModel<F> {
125126 . unwrap ( ) ;
126127 }
127128
128- async fn update_devices ( & mut self ) {
129- let devices = self
130- . flow_controller
131- . lock ( )
132- . await
133- . get_available_public_key_devices ( )
134- . await
135- . unwrap ( ) ;
129+ async fn update_devices ( & mut self , devices : Vec < Device > ) {
136130 self . devices = devices;
137131 self . tx_update
138132 . send ( ViewUpdate :: SetDevices ( self . devices . to_owned ( ) ) )
@@ -201,7 +195,7 @@ impl<F: FlowController + Send> ViewModel<F> {
201195 match event {
202196 Event :: View ( ViewEvent :: Initiated ) => {
203197 self . update_title ( ) . await ;
204- self . update_devices ( ) . await ;
198+ self . update_devices ( self . devices . clone ( ) ) . await ;
205199 }
206200 Event :: View ( ViewEvent :: DeviceSelected ( id) ) => {
207201 self . select_device ( & id) . await ;
0 commit comments