@@ -227,10 +227,10 @@ impl ActivityIndicator {
227
227
for status in & self . statuses {
228
228
match status. status {
229
229
LanguageServerBinaryStatus :: CheckingForUpdate => {
230
- checking_for_update. push ( status. name . 0 . as_ref ( ) )
230
+ checking_for_update. push ( status. name . clone ( ) )
231
231
}
232
- LanguageServerBinaryStatus :: Downloading => downloading. push ( status. name . 0 . as_ref ( ) ) ,
233
- LanguageServerBinaryStatus :: Failed { .. } => failed. push ( status. name . 0 . as_ref ( ) ) ,
232
+ LanguageServerBinaryStatus :: Downloading => downloading. push ( status. name . clone ( ) ) ,
233
+ LanguageServerBinaryStatus :: Failed { .. } => failed. push ( status. name . clone ( ) ) ,
234
234
LanguageServerBinaryStatus :: None => { }
235
235
}
236
236
}
@@ -242,8 +242,24 @@ impl ActivityIndicator {
242
242
. size ( IconSize :: Small )
243
243
. into_any_element ( ) ,
244
244
) ,
245
- message : format ! ( "Downloading {}..." , downloading. join( ", " ) , ) ,
246
- on_click : None ,
245
+ message : format ! (
246
+ "Downloading {}..." ,
247
+ downloading. iter( ) . map( |name| name. 0 . as_ref( ) ) . fold(
248
+ String :: new( ) ,
249
+ |mut acc, s| {
250
+ if !acc. is_empty( ) {
251
+ acc. push_str( ", " ) ;
252
+ }
253
+ acc. push_str( s) ;
254
+ acc
255
+ }
256
+ )
257
+ ) ,
258
+ on_click : Some ( Arc :: new ( move |this, cx| {
259
+ this. statuses
260
+ . retain ( |status| !downloading. contains ( & status. name ) ) ;
261
+ this. dismiss_error_message ( & DismissErrorMessage , cx)
262
+ } ) ) ,
247
263
} ) ;
248
264
}
249
265
@@ -256,9 +272,22 @@ impl ActivityIndicator {
256
272
) ,
257
273
message : format ! (
258
274
"Checking for updates to {}..." ,
259
- checking_for_update. join( ", " ) ,
275
+ checking_for_update. iter( ) . map( |name| name. 0 . as_ref( ) ) . fold(
276
+ String :: new( ) ,
277
+ |mut acc, s| {
278
+ if !acc. is_empty( ) {
279
+ acc. push_str( ", " ) ;
280
+ }
281
+ acc. push_str( s) ;
282
+ acc
283
+ }
284
+ ) ,
260
285
) ,
261
- on_click : None ,
286
+ on_click : Some ( Arc :: new ( move |this, cx| {
287
+ this. statuses
288
+ . retain ( |status| !checking_for_update. contains ( & status. name ) ) ;
289
+ this. dismiss_error_message ( & DismissErrorMessage , cx)
290
+ } ) ) ,
262
291
} ) ;
263
292
}
264
293
@@ -271,7 +300,16 @@ impl ActivityIndicator {
271
300
) ,
272
301
message : format ! (
273
302
"Failed to download {}. Click to show error." ,
274
- failed. join( ", " ) ,
303
+ failed
304
+ . iter( )
305
+ . map( |name| name. 0 . as_ref( ) )
306
+ . fold( String :: new( ) , |mut acc, s| {
307
+ if !acc. is_empty( ) {
308
+ acc. push_str( ", " ) ;
309
+ }
310
+ acc. push_str( s) ;
311
+ acc
312
+ } ) ,
275
313
) ,
276
314
on_click : Some ( Arc :: new ( |this, cx| {
277
315
this. show_error_message ( & Default :: default ( ) , cx)
@@ -304,7 +342,9 @@ impl ActivityIndicator {
304
342
. into_any_element ( ) ,
305
343
) ,
306
344
message : "Checking for Zed updates…" . to_string ( ) ,
307
- on_click : None ,
345
+ on_click : Some ( Arc :: new ( |this, cx| {
346
+ this. dismiss_error_message ( & DismissErrorMessage , cx)
347
+ } ) ) ,
308
348
} ) ,
309
349
AutoUpdateStatus :: Downloading => Some ( Content {
310
350
icon : Some (
@@ -313,7 +353,9 @@ impl ActivityIndicator {
313
353
. into_any_element ( ) ,
314
354
) ,
315
355
message : "Downloading Zed update…" . to_string ( ) ,
316
- on_click : None ,
356
+ on_click : Some ( Arc :: new ( |this, cx| {
357
+ this. dismiss_error_message ( & DismissErrorMessage , cx)
358
+ } ) ) ,
317
359
} ) ,
318
360
AutoUpdateStatus :: Installing => Some ( Content {
319
361
icon : Some (
@@ -322,7 +364,9 @@ impl ActivityIndicator {
322
364
. into_any_element ( ) ,
323
365
) ,
324
366
message : "Installing Zed update…" . to_string ( ) ,
325
- on_click : None ,
367
+ on_click : Some ( Arc :: new ( |this, cx| {
368
+ this. dismiss_error_message ( & DismissErrorMessage , cx)
369
+ } ) ) ,
326
370
} ) ,
327
371
AutoUpdateStatus :: Updated { binary_path } => Some ( Content {
328
372
icon : None ,
@@ -342,7 +386,7 @@ impl ActivityIndicator {
342
386
) ,
343
387
message : "Auto update failed" . to_string ( ) ,
344
388
on_click : Some ( Arc :: new ( |this, cx| {
345
- this. dismiss_error_message ( & Default :: default ( ) , cx)
389
+ this. dismiss_error_message ( & DismissErrorMessage , cx)
346
390
} ) ) ,
347
391
} ) ,
348
392
AutoUpdateStatus :: Idle => None ,
@@ -360,7 +404,9 @@ impl ActivityIndicator {
360
404
. into_any_element ( ) ,
361
405
) ,
362
406
message : format ! ( "Updating {extension_id} extension…" ) ,
363
- on_click : None ,
407
+ on_click : Some ( Arc :: new ( |this, cx| {
408
+ this. dismiss_error_message ( & DismissErrorMessage , cx)
409
+ } ) ) ,
364
410
} ) ;
365
411
}
366
412
}
0 commit comments