refactor: react router (#5073)

* refactor: react router

* chore: update

* fix: router

* refactor: generate router children by navItems

* chore: set start page when create window

* docs: update UPDATELOG.md
This commit is contained in:
oomeow
2025-10-18 20:25:31 +08:00
committed by GitHub
parent 8e20b1b0a0
commit 96ce529b16
16 changed files with 74 additions and 115 deletions

View File

@@ -338,7 +338,15 @@ impl IVerge {
pub async fn new() -> Self {
match dirs::verge_path() {
Ok(path) => match help::read_yaml::<IVerge>(&path).await {
Ok(config) => config,
Ok(mut config) => {
// compatibility
if let Some(start_page) = config.start_page.clone()
&& start_page == "/home"
{
config.start_page = Some(String::from("/"));
}
config
}
Err(err) => {
log::error!(target: "app", "{err}");
Self::template()
@@ -362,7 +370,7 @@ impl IVerge {
env_type: Some("bash".into()),
#[cfg(target_os = "windows")]
env_type: Some("powershell".into()),
start_page: Some("/home".into()),
start_page: Some("/".into()),
traffic_graph: Some(true),
enable_memory_usage: Some(true),
enable_group_icon: Some(true),