summary refs log tree commit diff
path: root/src/ui/UIA.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/UIA.cpp')
-rw-r--r--src/ui/UIA.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/ui/UIA.cpp b/src/ui/UIA.cpp
index 9654c9aa..4c1d35b9 100644
--- a/src/ui/UIA.cpp
+++ b/src/ui/UIA.cpp
@@ -13,8 +13,6 @@
 
 #include "Logging.h"
 #include "MatrixClient.h"
-#include "ReCaptcha.h"
-#include "dialogs/FallbackAuth.h"
 
 UIA *
 UIA::instance()
@@ -132,23 +130,18 @@ UIA::genericHandler(QString context)
                 }
             } else {
                 // use fallback
-                auto dialog = new dialogs::FallbackAuth(QString::fromStdString(current_stage),
-                                                        QString::fromStdString(u.session),
-                                                        nullptr);
-                dialog->setWindowTitle(context);
-
-                connect(dialog, &dialogs::FallbackAuth::confirmation, this, [h, u, dialog]() {
-                    dialog->close();
-                    dialog->deleteLater();
+                auto fallback = new FallbackAuth(QString::fromStdString(u.session),
+                                                 QString::fromStdString(current_stage),
+                                                 nullptr);
+                QQmlEngine::setObjectOwnership(fallback, QQmlEngine::JavaScriptOwnership);
+                connect(fallback, &FallbackAuth::confirmation, this, [h, u]() {
                     h.next(mtx::user_interactive::Auth{u.session,
                                                        mtx::user_interactive::auth::Fallback{}});
                 });
-
-                connect(dialog, &dialogs::FallbackAuth::cancel, this, [this]() {
+                connect(fallback, &FallbackAuth::cancelled, this, [this]() {
                     emit error(tr("Registration aborted"));
                 });
-
-                dialog->show();
+                emit fallbackAuth(fallback);
             }
         });
     });