@@ -79,6 +79,12 @@ public string InstalledAssetsSearch
7979 }
8080 }
8181
82+ public bool AllowArchiveLoad
83+ {
84+ get => _allowArchiveLoad ;
85+ set => SetProperty ( ref _allowArchiveLoad , value ) ;
86+ }
87+
8288 public bool UninstallButtonEnabled => SelectedInstallNodes . Any ( ) && SelectedInstallNodes . All ( d => d . Parent is null ) ;
8389
8490 private string _statusText = "Ready" ;
@@ -87,6 +93,7 @@ public string InstalledAssetsSearch
8793 private int _statusProgress ;
8894 private int _statusBarMax = 100 ;
8995 private IImmutableSolidColorBrush _statusBarColor = Brushes . DodgerBlue ;
96+ private bool _allowArchiveLoad ;
9097
9198 public string StatusText
9299 {
@@ -202,6 +209,7 @@ private async Task InstallArchives()
202209 if ( CurrentSelectedAssetLibrary is null )
203210 return ;
204211
212+ AllowArchiveLoad = false ;
205213 var archivesToInstall =
206214 SelectedArchives . Count > 0 ? SelectedArchives . ToList ( ) : LoadedArchives . ToList ( ) ;
207215
@@ -252,10 +260,15 @@ await Task.Run(async () =>
252260 }
253261 } ) ;
254262
255- await LoadInstalledArchivesAsync ( ) ;
263+ await Task . Run ( async ( ) =>
264+ {
265+ await LoadInstalledArchivesAsync ( ) ;
266+ } ) ;
267+
256268 messageProgress . Report ( $ "Installed { archivesToInstall . Count } archives") ;
257269 percentageProgress . Report ( 100 ) ;
258270 StatusBarColor = Brushes . Green ;
271+ AllowArchiveLoad = true ;
259272 }
260273
261274 private static string GetLoadedArchiveName ( LoadedArchive archiveOld ) =>
@@ -268,6 +281,7 @@ private async Task UninstallArchiveAsync()
268281 if ( ! SelectedInstallNodes . Any ( ) )
269282 return ;
270283
284+ AllowArchiveLoad = false ;
271285 await using var dbContext = await _dbContextFactory . CreateDbContextAsync ( ) ;
272286
273287 var selectedInstallArchiveIds = SelectedInstallNodes . Select ( n => n . DbId ) . ToArray ( ) ;
@@ -322,14 +336,20 @@ await Task.Run(async () =>
322336 StatusBarColor = Brushes . Green ;
323337 } ) ;
324338
325- await LoadInstalledArchivesAsync ( ) ;
339+ await Task . Run ( async ( ) =>
340+ {
341+ await LoadInstalledArchivesAsync ( ) ;
342+ } ) ;
343+
344+ AllowArchiveLoad = true ;
326345 }
327346
328347 public async Task LoadArchiveFilesAsync ( List < string > filePaths )
329348 {
330349 StatusBarMax = 100 * filePaths . Count ;
331350 StatusProgress = 0 ;
332351 StatusBarColor = Brushes . DodgerBlue ;
352+ AllowArchiveLoad = false ;
333353
334354 var index = 0 ;
335355
@@ -356,6 +376,7 @@ await Task.Run(async () =>
356376
357377 StatusBarMax = 100 ;
358378 StatusBarColor = Brushes . Green ;
379+ AllowArchiveLoad = true ;
359380 }
360381
361382 private void FilterInstalledAssetsTree ( string ? searchTerm )
0 commit comments