mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
bugfix: fixed transition to the "Installed services" page when importing a config that does not have installed containers
This commit is contained in:
@@ -166,14 +166,6 @@ bool StartPageLogic::importConnection(const QJsonObject &profile)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!profile.contains(config_key::containers)) {
|
|
||||||
uiLogic()->selectedServerIndex = m_settings->defaultServerIndex();
|
|
||||||
uiLogic()->selectedDockerContainer = m_settings->defaultContainer(uiLogic()->selectedServerIndex);
|
|
||||||
uiLogic()->onUpdateAllPages();
|
|
||||||
|
|
||||||
emit uiLogic()->goToPage(Page::ServerContainers);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,17 @@ void ViewConfigLogic::importConfig()
|
|||||||
m_settings->addServer(configJson());
|
m_settings->addServer(configJson());
|
||||||
m_settings->setDefaultServer(m_settings->serversCount() - 1);
|
m_settings->setDefaultServer(m_settings->serversCount() - 1);
|
||||||
|
|
||||||
|
|
||||||
|
if (!configJson().contains(config_key::containers) || configJson().value(config_key::containers).toArray().isEmpty()) {
|
||||||
|
uiLogic()->selectedServerIndex = m_settings->defaultServerIndex();
|
||||||
|
uiLogic()->selectedDockerContainer = m_settings->defaultContainer(uiLogic()->selectedServerIndex);
|
||||||
|
uiLogic()->onUpdateAllPages();
|
||||||
|
emit uiLogic()->goToPage(Page::Vpn);
|
||||||
|
emit uiLogic()->setStartPage(Page::Vpn);
|
||||||
|
emit uiLogic()->goToPage(Page::ServerContainers);
|
||||||
|
} else {
|
||||||
emit uiLogic()->goToPage(Page::Vpn);
|
emit uiLogic()->goToPage(Page::Vpn);
|
||||||
emit uiLogic()->setStartPage(Page::Vpn);
|
emit uiLogic()->setStartPage(Page::Vpn);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user