mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-02-05 22:49:07 +00:00
25 lines
746 B
C#
25 lines
746 B
C#
using AIStudio.Settings;
|
|
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.JSInterop;
|
|
|
|
namespace AIStudio.Components.Layout;
|
|
|
|
public partial class MainLayout : LayoutComponentBase
|
|
{
|
|
[Inject]
|
|
private IJSRuntime JsRuntime { get; set; } = null!;
|
|
|
|
#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;
|
|
|
|
await base.OnInitializedAsync();
|
|
}
|
|
|
|
#endregion
|
|
} |