Don't pass Python Future objects to QML
Returning a Future doesn't work on Windows for some reason (https://github.com/thp/pyotherside/issues/116). Instead of using these objects from QML to cancel running coroutines, call a Python QMLBridge function that takes a coroutine UUID and will take care of the cancelling.
This commit is contained in:
		| @@ -14,23 +14,23 @@ SignInBase { | ||||
|     function startSignIn() { | ||||
|         errorMessage.text = "" | ||||
|  | ||||
|         page.loginFuture = py.callCoro("start_sso_auth", [serverUrl], url => { | ||||
|         page.loginFutureId = py.callCoro("start_sso_auth",[serverUrl], url => { | ||||
|             urlArea.text           = url | ||||
|             urlArea.cursorPosition = 0 | ||||
|  | ||||
|             Qt.openUrlExternally(url) | ||||
|  | ||||
|             page.loginFuture = py.callCoro("continue_sso_auth", [], userId => { | ||||
|                 page.loginFuture = null | ||||
|             page.loginFutureId = py.callCoro("continue_sso_auth",[],userId => { | ||||
|                 page.loginFutureId = "" | ||||
|                 page.finishSignIn(userId) | ||||
|             }) | ||||
|         }) | ||||
|     } | ||||
|  | ||||
|     function cancel() { | ||||
|         if (loginFuture) { | ||||
|             page.loginFuture.cancel() | ||||
|             page.loginFuture = null | ||||
|         if (loginFutureId) { | ||||
|             py.cancelCoro(page.loginFutureId) | ||||
|             page.loginFutureId = "" | ||||
|         } | ||||
|  | ||||
|         page.exitRequested() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	