File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
src/dashboard/Synapse.Dashboard
Components/ResourceEditor Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 125125 protected override async Task OnInitializedAsync ()
126126 {
127127 await base .OnInitializedAsync ().ConfigureAwait (false );
128+ this .Store .IsSaving .Subscribe (saving => this .OnStateChanged (cmp => this .OnSavingChanged (saving )), token : this .CancellationTokenSource .Token );
128129 this .Store .Resource .Subscribe (resource => this .OnStateChanged (cmp => cmp .resource = resource ), token : this .CancellationTokenSource .Token );
129130 this .Store .IsUpdating .Subscribe (updating => this .OnStateChanged (cmp => cmp .isUpdating = updating ), token : this .CancellationTokenSource .Token );
130- this .Store .IsSaving .Subscribe (OnSavingChanged , token : this .CancellationTokenSource .Token );
131131 this .Store .ProblemDetails .Subscribe (problemDetails => this .OnStateChanged (cmp => cmp .problemDetails = problemDetails ), token : this .CancellationTokenSource .Token );
132132 this .textEditorInput
133133 .Throttle (TimeSpan .FromMilliseconds (300 ))
148148 {
149149 this .resource = this .Resource ; // should happen in this.Store.Resource.Subscribe but prevents possible race when multiple params are set
150150 this .Store .SetResource (this .Resource );
151+ this .Store .SetProblemDetails (null );
151152 }
152153 if (this .isCluster != this .IsCluster )
153154 {
178179 {
179180 this .isSaving = saving ;
180181 if (this .textBasedEditor != null ) this .textBasedEditor .UpdateOptions (new EditorUpdateOptions () { ReadOnly = saving });
181- this .StateHasChanged ();
182182 }
183183
184184 /// <summary >
199199 await this .SetTextEditorValueAsync ();
200200 await this .SetTextBasedEditorLanguageAsync ();
201201 }
202- this .StateHasChanged ();
202+ this .OnStateChanged ();
203203 }
204204
205205 /// <summary >
Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ protected override async Task OnInitializedAsync()
6161 /// Patches the component fields after a change
6262 /// </summary>
6363 /// <param name="patch">The patch to apply</param>
64- protected void OnStateChanged ( Action < TComponent > patch )
64+ protected void OnStateChanged ( Action < TComponent > ? patch = null )
6565 {
66- patch ( ( TComponent ) this ) ;
66+ if ( patch != null ) patch ( ( TComponent ) this ) ;
6767 this . shouldRender = true ;
6868 this . StateHasChanged ( ) ;
6969 }
You can’t perform that action at this time.
0 commit comments