Added settings manager to handle configuration

This commit is contained in:
tsommer committed 2024-04-05 22:23:36 +02:00
1 parent b02b39c023
commit 583f530d28
3 files changed
+36 -4

No files matched your search

@@ -1,11 +1,22 @@
namespace MindWork_AI_Studio.Components.Layout;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
public partial class MainLayout
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();
}