mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 11:39:48 +00:00
Fixed order of initialization
This commit is contained in:
parent
18aadebfff
commit
989fb05210
@ -103,6 +103,8 @@ public abstract partial class AssistantBase<TSettings> : AssistantLowerBase wher
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
|
||||||
this.formChangeTimer.AutoReset = false;
|
this.formChangeTimer.AutoReset = false;
|
||||||
this.formChangeTimer.Elapsed += async (_, _) =>
|
this.formChangeTimer.Elapsed += async (_, _) =>
|
||||||
{
|
{
|
||||||
@ -113,7 +115,6 @@ public abstract partial class AssistantBase<TSettings> : AssistantLowerBase wher
|
|||||||
this.MightPreselectValues();
|
this.MightPreselectValues();
|
||||||
this.providerSettings = this.SettingsManager.GetPreselectedProvider(this.Component);
|
this.providerSettings = this.SettingsManager.GetPreselectedProvider(this.Component);
|
||||||
this.currentProfile = this.SettingsManager.GetPreselectedProfile(this.Component);
|
this.currentProfile = this.SettingsManager.GetPreselectedProfile(this.Component);
|
||||||
await base.OnInitializedAsync();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task OnParametersSetAsync()
|
protected override async Task OnParametersSetAsync()
|
||||||
|
@ -39,6 +39,8 @@ public partial class Workspaces : MSGComponentBase
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Notice: In order to get the server-based loading to work, we need to respect the following rules:
|
// Notice: In order to get the server-based loading to work, we need to respect the following rules:
|
||||||
// - We must have initial tree items
|
// - We must have initial tree items
|
||||||
@ -46,7 +48,6 @@ public partial class Workspaces : MSGComponentBase
|
|||||||
// - When assigning the tree items to the MudTreeViewItem component, we must set the Value property to the value of the item
|
// - When assigning the tree items to the MudTreeViewItem component, we must set the Value property to the value of the item
|
||||||
//
|
//
|
||||||
await this.LoadTreeItems();
|
await this.LoadTreeItems();
|
||||||
await base.OnInitializedAsync();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -504,4 +505,19 @@ public partial class Workspaces : MSGComponentBase
|
|||||||
await this.LoadChat(chatPath, switchToChat: true);
|
await this.LoadChat(chatPath, switchToChat: true);
|
||||||
await this.LoadTreeItems();
|
await this.LoadTreeItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Overrides of MSGComponentBase
|
||||||
|
|
||||||
|
protected override async Task ProcessIncomingMessage<T>(ComponentBase? sendingComponent, Event triggeredEvent, T? data) where T : default
|
||||||
|
{
|
||||||
|
switch (triggeredEvent)
|
||||||
|
{
|
||||||
|
case Event.PLUGINS_RELOADED:
|
||||||
|
await this.LoadTreeItems();
|
||||||
|
await this.InvokeAsync(this.StateHasChanged);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
@ -27,11 +27,12 @@ public abstract class SettingsDialogBase : MSGComponentBase
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
|
||||||
this.ApplyFilters([], [ Event.CONFIGURATION_CHANGED ]);
|
this.ApplyFilters([], [ Event.CONFIGURATION_CHANGED ]);
|
||||||
|
|
||||||
this.UpdateProviders();
|
this.UpdateProviders();
|
||||||
this.UpdateEmbeddingProviders();
|
this.UpdateEmbeddingProviders();
|
||||||
await base.OnInitializedAsync();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user