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 125
125
protected override async Task OnInitializedAsync ()
126
126
{
127
127
await base .OnInitializedAsync ().ConfigureAwait (false );
128
+ this .Store .IsSaving .Subscribe (saving => this .OnStateChanged (cmp => this .OnSavingChanged (saving )), token : this .CancellationTokenSource .Token );
128
129
this .Store .Resource .Subscribe (resource => this .OnStateChanged (cmp => cmp .resource = resource ), token : this .CancellationTokenSource .Token );
129
130
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 );
131
131
this .Store .ProblemDetails .Subscribe (problemDetails => this .OnStateChanged (cmp => cmp .problemDetails = problemDetails ), token : this .CancellationTokenSource .Token );
132
132
this .textEditorInput
133
133
.Throttle (TimeSpan .FromMilliseconds (300 ))
148
148
{
149
149
this .resource = this .Resource ; // should happen in this.Store.Resource.Subscribe but prevents possible race when multiple params are set
150
150
this .Store .SetResource (this .Resource );
151
+ this .Store .SetProblemDetails (null );
151
152
}
152
153
if (this .isCluster != this .IsCluster )
153
154
{
178
179
{
179
180
this .isSaving = saving ;
180
181
if (this .textBasedEditor != null ) this .textBasedEditor .UpdateOptions (new EditorUpdateOptions () { ReadOnly = saving });
181
- this .StateHasChanged ();
182
182
}
183
183
184
184
/// <summary >
199
199
await this .SetTextEditorValueAsync ();
200
200
await this .SetTextBasedEditorLanguageAsync ();
201
201
}
202
- this .StateHasChanged ();
202
+ this .OnStateChanged ();
203
203
}
204
204
205
205
/// <summary >
Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ protected override async Task OnInitializedAsync()
61
61
/// Patches the component fields after a change
62
62
/// </summary>
63
63
/// <param name="patch">The patch to apply</param>
64
- protected void OnStateChanged ( Action < TComponent > patch )
64
+ protected void OnStateChanged ( Action < TComponent > ? patch = null )
65
65
{
66
- patch ( ( TComponent ) this ) ;
66
+ if ( patch != null ) patch ( ( TComponent ) this ) ;
67
67
this . shouldRender = true ;
68
68
this . StateHasChanged ( ) ;
69
69
}
You can’t perform that action at this time.
0 commit comments