@@ -21,7 +21,7 @@ along with Foobar. If not, see
2121@inject ISessionStateContainer _sessionStateContainer
2222@inject ImportManager _importManager
2323
24- <MudStepper NonLinear OnPreviewInteraction =" PreviewInteraction" @bind-ActiveIndex =" activeStepIndex" >
24+ <MudStepper @ref = " mudStepper " NonLinear OnPreviewInteraction =" PreviewInteraction" @bind-ActiveIndex =" activeStepIndex" >
2525 <MudStep Title =" @_localizer[" Select inputfiles " ]" Completed =" selectFilesStepCompleted" HasError =" selectFilesStepError" >
2626 <SelectImportFiles FilesImported =" FilesImported" InvalidFilesChanged =" InvalidFilesDropped" />
2727 </MudStep >
@@ -63,6 +63,7 @@ along with Foobar. If not, see
6363</MudStepper >
6464
6565@code {
66+ MudStepper ? mudStepper ;
6667 int activeStepIndex ;
6768 Boolean fileContentExpanded = false , cuesheetDataExpanded = false , cuesheetTracksExpanded = false ;
6869 Boolean selectFilesStepCompleted = false , selectFilesStepError = false ;
@@ -94,8 +95,10 @@ along with Foobar. If not, see
9495
9596 async Task CompleteImportAsync ()
9697 {
97- await LocalStorageOptionsProvider .SaveOptionsValueAsync <ApplicationOptions >(x => x .ActiveTab , ViewMode .DetailView );
9898 _importManager .ImportCuesheet ();
99+ await ResetAsync ();
100+ // Don't await since otherwise the rendering will stop and this view will not be reset
101+ _ = LocalStorageOptionsProvider .SaveOptionsValueAsync <ApplicationOptions >(x => x .ActiveTab , ViewMode .DetailView );
99102 }
100103
101104 Task PreviewInteraction (StepperInteractionEventArgs arg )
@@ -111,4 +114,15 @@ along with Foobar. If not, see
111114 {
112115 selectFilesStepError = files .Any ();
113116 }
117+
118+ async Task ResetAsync ()
119+ {
120+ activeStepIndex = 0 ;
121+ selectFilesStepCompleted = false ;
122+ selectFilesStepError = false ;
123+ if (mudStepper != null )
124+ {
125+ await mudStepper .ResetAsync (true );
126+ }
127+ }
114128}
0 commit comments