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

25 lines
746 B
C#
Raw Normal View History

2024-04-19 19:25:44 +00:00
using AIStudio.Settings;
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
}