From 189cc9668f66d67ca3da8a6bd3d9d31716b44293 Mon Sep 17 00:00:00 2001 From: Christer C Date: Thu, 12 Sep 2024 20:29:45 +0200 Subject: [PATCH] Fixes #115 (#116) --- .../Highbyte.DotNet6502.App.WASM/Pages/Index.razor.cs | 1 + src/apps/Highbyte.DotNet6502.App.WASM/global.json | 2 +- .../Highbyte.DotNet6502.App.WASM/local_publish_run.ps1 | 2 +- src/libraries/Highbyte.DotNet6502.Systems/HostApp.cs | 8 ++++---- .../Highbyte.DotNet6502.Systems/SystemList.cs | 10 +++++----- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/apps/Highbyte.DotNet6502.App.WASM/Pages/Index.razor.cs b/src/apps/Highbyte.DotNet6502.App.WASM/Pages/Index.razor.cs index 4b72e223..d9bba7d2 100644 --- a/src/apps/Highbyte.DotNet6502.App.WASM/Pages/Index.razor.cs +++ b/src/apps/Highbyte.DotNet6502.App.WASM/Pages/Index.razor.cs @@ -327,6 +327,7 @@ public async Task ShowConfigUI() where T : IComponent var resultData = ((ISystemConfig UpdatedSystemConfig, IHostSystemConfig UpdatedHostSystemConfig))result.Data; _wasmHost.UpdateSystemConfig(resultData.UpdatedSystemConfig); + await _wasmHost.PersistCurrentSystemConfig(); _wasmHost.UpdateHostSystemConfig(resultData.UpdatedHostSystemConfig); } diff --git a/src/apps/Highbyte.DotNet6502.App.WASM/global.json b/src/apps/Highbyte.DotNet6502.App.WASM/global.json index 1978c843..bfca90d3 100644 --- a/src/apps/Highbyte.DotNet6502.App.WASM/global.json +++ b/src/apps/Highbyte.DotNet6502.App.WASM/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.303" + "version": "8.0.400" } } \ No newline at end of file diff --git a/src/apps/Highbyte.DotNet6502.App.WASM/local_publish_run.ps1 b/src/apps/Highbyte.DotNet6502.App.WASM/local_publish_run.ps1 index c6fb4026..fa0d5ed5 100644 --- a/src/apps/Highbyte.DotNet6502.App.WASM/local_publish_run.ps1 +++ b/src/apps/Highbyte.DotNet6502.App.WASM/local_publish_run.ps1 @@ -2,4 +2,4 @@ $publishDir = "./bin/Publish/" $path = "/?audioEnabled=true" if(Test-Path $publishDir) { del $publishDir -r -force } dotnet publish -c Release -o $publishDir -dotnet serve -o:$path --directory "$($publishDir)wwwroot\" \ No newline at end of file +dotnet serve --port 5001 -o:$path --directory "$($publishDir)wwwroot\" \ No newline at end of file diff --git a/src/libraries/Highbyte.DotNet6502.Systems/HostApp.cs b/src/libraries/Highbyte.DotNet6502.Systems/HostApp.cs index 8d5e58cf..4221d4af 100644 --- a/src/libraries/Highbyte.DotNet6502.Systems/HostApp.cs +++ b/src/libraries/Highbyte.DotNet6502.Systems/HostApp.cs @@ -366,10 +366,10 @@ public void UpdateSystemConfig(ISystemConfig newConfig) _systemList.ChangeCurrentSystemConfig(_selectedSystemName, CurrentSystemConfig, _selectedSystemConfigurationVariant); } - //public async Task PersistNewSystemConfig(ISystemConfig newConfig) - //{ - // await _systemList.PersistNewSystemConfig(_selectedSystemName, newConfig); - //} + public async Task PersistCurrentSystemConfig() + { + await _systemList.PersistSystemConfig(_selectedSystemName, _selectedSystemConfigurationVariant); + } public void UpdateHostSystemConfig(IHostSystemConfig newConfig) { diff --git a/src/libraries/Highbyte.DotNet6502.Systems/SystemList.cs b/src/libraries/Highbyte.DotNet6502.Systems/SystemList.cs index 9059d26e..979a162c 100644 --- a/src/libraries/Highbyte.DotNet6502.Systems/SystemList.cs +++ b/src/libraries/Highbyte.DotNet6502.Systems/SystemList.cs @@ -215,11 +215,11 @@ public void ChangeCurrentSystemConfig(string systemName, ISystemConfig systemCon // await PersistSystemConfig(systemName); //} - //public async Task PersistSystemConfig(string systemName, string configurationVariant) - //{ - // var systemConfig = await GetSystemConfig(systemName, configurationVariant); - // await _systemConfigurers[systemName].PersistConfig(systemConfig); - //} + public async Task PersistSystemConfig(string systemName, string configurationVariant) + { + var systemConfig = await GetSystemConfig(systemName, configurationVariant); + await _systemConfigurers[systemName].PersistConfig(systemConfig); + } public async Task IsValidConfig(string systemName, string configurationVariant) {