From b2395350090ed4a5a587afe3e1cf4b5663d73d7d Mon Sep 17 00:00:00 2001 From: rustdesk Date: Wed, 22 Apr 2026 01:41:13 +0800 Subject: [PATCH] refactor per code review --- flutter/lib/web/bridge.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flutter/lib/web/bridge.dart b/flutter/lib/web/bridge.dart index 3d52e7d5d..a3d93f88e 100644 --- a/flutter/lib/web/bridge.dart +++ b/flutter/lib/web/bridge.dart @@ -1539,12 +1539,12 @@ class RustdeskImpl { Future mainAccountAuth( {required String op, required bool rememberMe, dynamic hint}) { // Safari only allows auth popups while handling the original user gesture. - // Call into JS synchronously so the web OIDC flow can pre-open the window. - js.context.callMethod('setByName', [ + // Use Future.sync so the JS call runs synchronously (pre-opening the OIDC + // window) while any interop error still surfaces as a Future error. + return Future.sync(() => js.context.callMethod('setByName', [ 'account_auth', jsonEncode({'op': op, 'remember': rememberMe}) - ]); - return Future.value(); + ])); } Future mainAccountAuthCancel({dynamic hint}) {