From fa760e910c3e421f9a3a92e3c3478bc09c8b6496 Mon Sep 17 00:00:00 2001 From: "Brady Stroud [SSW]" Date: Thu, 23 Nov 2023 11:51:48 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20Update=20package=20versions=20an?= =?UTF-8?q?d=20refactor=20variable=20names?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit accomplishes two main tasks. Firstly, it updates the versions for several packages in the .csproj files of TimesheetGPT.WebUI, TimesheetGPT.Core, and TimesheetGPT.WebAPI for better performance, latest features, and security improvements. Secondly, it refactors some variable names in the MainLayout.razor file of TimesheetGPT.WebUI to follow naming conventions, improving code readability. --- src/TimesheetGPT.Core/TimesheetGPT.Core.csproj | 12 ++++++------ .../TimesheetGPT.WebAPI.csproj | 4 ++-- src/TimesheetGPT.WebUI/Shared/MainLayout.razor | 17 +++++++++-------- .../TimesheetGPT.WebUI.csproj | 14 +++++++------- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/TimesheetGPT.Core/TimesheetGPT.Core.csproj b/src/TimesheetGPT.Core/TimesheetGPT.Core.csproj index 1ced966..a5423a0 100644 --- a/src/TimesheetGPT.Core/TimesheetGPT.Core.csproj +++ b/src/TimesheetGPT.Core/TimesheetGPT.Core.csproj @@ -8,13 +8,13 @@ - - - - + + + + - - + + diff --git a/src/TimesheetGPT.WebAPI/TimesheetGPT.WebAPI.csproj b/src/TimesheetGPT.WebAPI/TimesheetGPT.WebAPI.csproj index d38b0d1..02d042a 100644 --- a/src/TimesheetGPT.WebAPI/TimesheetGPT.WebAPI.csproj +++ b/src/TimesheetGPT.WebAPI/TimesheetGPT.WebAPI.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/src/TimesheetGPT.WebUI/Shared/MainLayout.razor b/src/TimesheetGPT.WebUI/Shared/MainLayout.razor index 5e57c93..35668d7 100644 --- a/src/TimesheetGPT.WebUI/Shared/MainLayout.razor +++ b/src/TimesheetGPT.WebUI/Shared/MainLayout.razor @@ -16,7 +16,7 @@ - @switch (themePreference) + @switch (_themePreference) { case ThemePreference.Light: @@ -52,15 +52,15 @@ @code { private MudThemeProvider? _mudThemeProvider; - ThemePreference themePreference; + ThemePreference _themePreference; private bool _isDarkMode; - private bool systemIsDarkMode; + private bool _systemIsDarkMode; protected async override Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { - systemIsDarkMode = await _mudThemeProvider.GetSystemPreference(); + _systemIsDarkMode = await _mudThemeProvider.GetSystemPreference(); await _mudThemeProvider.WatchSystemPreference(OnSystemPreferenceChanged); StateHasChanged(); } @@ -68,8 +68,8 @@ private async Task OnSystemPreferenceChanged(bool newValue) { - systemIsDarkMode = newValue; - SetThemePreference(themePreference); + _systemIsDarkMode = newValue; + SetThemePreference(_themePreference); StateHasChanged(); } @@ -111,15 +111,16 @@ } }; + private void SetThemePreference(ThemePreference preference) { - themePreference = preference; + _themePreference = preference; _isDarkMode = preference switch { ThemePreference.Light => false, ThemePreference.Dark => true, - ThemePreference.System => systemIsDarkMode, + ThemePreference.System => _systemIsDarkMode, _ => true }; diff --git a/src/TimesheetGPT.WebUI/TimesheetGPT.WebUI.csproj b/src/TimesheetGPT.WebUI/TimesheetGPT.WebUI.csproj index ca63faa..3dedf14 100644 --- a/src/TimesheetGPT.WebUI/TimesheetGPT.WebUI.csproj +++ b/src/TimesheetGPT.WebUI/TimesheetGPT.WebUI.csproj @@ -15,13 +15,13 @@ - - - - - - - + + + + + + +