refactor: cleanup

This commit is contained in:
2025-01-25 14:27:55 +07:00
parent 4680aa9f9f
commit 7049e8489a
5 changed files with 15 additions and 12 deletions

4
.gitignore vendored
View File

@@ -2,4 +2,6 @@ bin/
obj/ obj/
/packages/ /packages/
riderModule.iml riderModule.iml
/_ReSharper.Caches/ /_ReSharper.Caches/
.idea/
*.sln.DotSettings.user

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View File

@@ -6,9 +6,14 @@ public partial class MainLayout
{ {
// To allow the menu button to control the drawer // To allow the menu button to control the drawer
private NavigationDrawer _drawer = null!; private NavigationDrawer _drawer = null!;
// To control the dark mode
private bool _isDarkMode; private bool _isDarkMode;
// Indicates if the component is initializing, hence would not render anything to not confuse the user
private bool _isInitialing = true; private bool _isInitialing = true;
// Used for the system preference for dark mode
private MudThemeProvider _mudThemeProvider = null!; private MudThemeProvider _mudThemeProvider = null!;
protected override async Task OnAfterRenderAsync(bool firstRender) protected override async Task OnAfterRenderAsync(bool firstRender)
@@ -22,7 +27,7 @@ public partial class MainLayout
StateHasChanged(); StateHasChanged();
} }
} }
/// <summary> /// <summary>
/// Method to handle the system preference change for dark mode /// Method to handle the system preference change for dark mode
/// </summary> /// </summary>
@@ -34,4 +39,4 @@ public partial class MainLayout
StateHasChanged(); StateHasChanged();
return Task.CompletedTask; return Task.CompletedTask;
} }
} }

View File

@@ -43,4 +43,4 @@ app.MapStaticAssets();
app.MapRazorComponents<App>() app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode(); .AddInteractiveServerRenderMode();
app.Run(); app.Run();

View File

@@ -98,7 +98,7 @@ public class CaddyService(IConfigurationsService configurationsService) : ICaddy
public CaddyDeleteOperationResponse DeleteCaddyConfigurations(List<string> configurationNames) public CaddyDeleteOperationResponse DeleteCaddyConfigurations(List<string> configurationNames)
{ {
var failed = new List<string>(); var failed = new List<string>();
foreach (var configurationName in configurationNames) foreach (var configurationName in configurationNames)
{ {
var filePath = Path.Combine(Configurations.ConfigDir, var filePath = Path.Combine(Configurations.ConfigDir,
@@ -120,7 +120,7 @@ public class CaddyService(IConfigurationsService configurationsService) : ICaddy
failed.Add(configurationName); failed.Add(configurationName);
} }
} }
return new CaddyDeleteOperationResponse return new CaddyDeleteOperationResponse
{ {
Success = failed.Count == 0, Success = failed.Count == 0,
@@ -130,4 +130,4 @@ public class CaddyService(IConfigurationsService configurationsService) : ICaddy
DeletedConfigurations = configurationNames.Except(failed).ToList() DeletedConfigurations = configurationNames.Except(failed).ToList()
}; };
} }
} }