AI-Studio/app/MindWork AI Studio/Components/Layout/MainLayout.razor.cs

24 lines
721 B
C#
Raw Normal View History

using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
2024-04-05 14:16:33 +00:00
namespace AIStudio.Components.Layout;
public partial class MainLayout : LayoutComponentBase
2024-04-05 14:16:33 +00:00
{
[Inject]
private IJSRuntime JsRuntime { get; set; } = null!;
2024-04-05 14:16:33 +00:00
#region Overrides of ComponentBase
protected override async Task OnInitializedAsync()
{
var dataDir = await this.JsRuntime.InvokeAsync<string>("window.__TAURI__.path.appLocalDataDir");
var configDir = await this.JsRuntime.InvokeAsync<string>("window.__TAURI__.path.appConfigDir");
SettingsManager.ConfigDirectory = configDir;
SettingsManager.DataDirectory = dataDir;
2024-04-05 14:16:33 +00:00
await base.OnInitializedAsync();
}
#endregion
}