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:
Tobias Fella
2023-11-03 15:27:52 +01:00
parent c4f6abee9d
commit 7f9e709559
9 changed files with 83 additions and 32 deletions

View File

@@ -63,6 +63,8 @@ class Controller : public QObject
*/
Q_PROPERTY(bool isFlatpak READ isFlatpak CONSTANT)
Q_PROPERTY(QStringList accountsLoading MEMBER m_accountsLoading NOTIFY accountsLoadingChanged)
public:
/**
* @brief Defines the status after an attempt to change the password on an account.
@@ -140,6 +142,7 @@ private:
QMap<Quotient::Room *, int> m_notificationCounts;
Quotient::AccountRegistry m_accountRegistry;
QStringList m_accountsLoading;
private Q_SLOTS:
void invokeLogin();
@@ -162,6 +165,7 @@ Q_SIGNALS:
void passwordStatus(Controller::PasswordStatus status);
void userConsentRequired(QUrl url);
void isOnlineChanged(bool isOnline);
void accountsLoadingChanged();
public Q_SLOTS:
void saveWindowGeometry();