Improve initial active connection handling
If the last active connection is not reachable (server down, keychain problems, token revoked, etc.), NeoChat currently fails to load at all, with the only fix being to delete a line from the config file. This is surprisingly hard to fix with a nice UX as long as we stick to the principle of loading the user's last active connection automatically. This patch thus drops that principle; instead, the user is always asked to choose the connection to continue with.
This commit is contained in:
@@ -31,7 +31,15 @@ Kirigami.ApplicationWindow {
|
||||
wideScreen: width > columnWidth * 5
|
||||
|
||||
pageStack {
|
||||
initialPage: LoadingPage {}
|
||||
initialPage: WelcomePage {
|
||||
showExisting: true
|
||||
onConnectionChosen: {
|
||||
pageStack.replace(roomListComponent);
|
||||
roomListLoaded = true;
|
||||
roomListPage = pageStack.currentItem
|
||||
RoomManager.loadInitialRoom();
|
||||
}
|
||||
}
|
||||
globalToolBar.canContainHandles: true
|
||||
defaultColumnWidth: roomListPage ? roomListPage.currentWidth : 0
|
||||
globalToolBar {
|
||||
@@ -47,6 +55,16 @@ Kirigami.ApplicationWindow {
|
||||
SpaceHierarchyCache.connection = root.connection
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: LoginHelper
|
||||
function onLoaded() {
|
||||
pageStack.replace(roomListComponent);
|
||||
roomListLoaded = true;
|
||||
roomListPage = pageStack.currentItem
|
||||
RoomManager.loadInitialRoom();
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: root.quitAction
|
||||
function onTriggered() {
|
||||
@@ -279,17 +297,6 @@ Kirigami.ApplicationWindow {
|
||||
Connections {
|
||||
target: Controller
|
||||
|
||||
function onInitiated() {
|
||||
if (AccountRegistry.accountCount === 0) {
|
||||
pageStack.replace("qrc:/org/kde/neochat/qml/WelcomePage.qml", {});
|
||||
} else if (!roomListLoaded) {
|
||||
pageStack.replace(roomListComponent);
|
||||
roomListLoaded = true;
|
||||
roomListPage = pageStack.currentItem
|
||||
RoomManager.loadInitialRoom();
|
||||
}
|
||||
}
|
||||
|
||||
function onGlobalErrorOccured(error, detail) {
|
||||
showPassiveNotification(i18n("%1: %2", error, detail));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user