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

View File

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

View File

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