@@ -130,14 +130,18 @@ observe(() => {
130
130
131
131
function setDrives ( drives : Dictionary < DrivelistDrive > ) {
132
132
// prevent setting drives while flashing otherwise we might lose some while we unmount them
133
- if ( ! flashState . isFlashing ( ) ) {
134
- availableDrives . setDrives ( values ( drives ) ) ;
135
- }
133
+ availableDrives . setDrives ( values ( drives ) ) ;
136
134
}
137
135
138
136
// Spawning the child process without privileges to get the drives list
139
137
// TODO: clean up this mess of exports
140
- export let requestMetadata : any ;
138
+ export let requestMetadata : ( params : any ) => Promise < SourceMetadata > ;
139
+ export let startScanner : ( ) => void = ( ) => {
140
+ console . log ( 'stopScanner is not yet set' ) ;
141
+ } ;
142
+ export let stopScanner : ( ) => void = ( ) => {
143
+ console . log ( 'stopScanner is not yet set' ) ;
144
+ } ;
141
145
142
146
// start the api and spawn the child process
143
147
spawnChildAndConnect ( {
@@ -147,6 +151,18 @@ spawnChildAndConnect({
147
151
// start scanning
148
152
emit ( 'scan' , { } ) ;
149
153
154
+ // make startScanner available for the end of flash
155
+ startScanner = ( ) => {
156
+ console . log ( 'startScanner' ) ;
157
+ emit ( 'scan' , { } ) ;
158
+ } ;
159
+
160
+ // make stopScanner available for the start of flash
161
+ stopScanner = ( ) => {
162
+ console . log ( 'stopScanner' ) ;
163
+ emit ( 'scan' , { } ) ;
164
+ } ;
165
+
150
166
// make the sourceMetada awaitable to be used on source selection
151
167
requestMetadata = async ( params : any ) : Promise < SourceMetadata > => {
152
168
emit ( 'sourceMetadata' , JSON . stringify ( params ) ) ;
0 commit comments