Skip to content

Commit b239535

Browse files
committed
refactor per code review
1 parent 5fd20f8 commit b239535

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

flutter/lib/web/bridge.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,12 +1539,12 @@ class RustdeskImpl {
15391539
Future<void> mainAccountAuth(
15401540
{required String op, required bool rememberMe, dynamic hint}) {
15411541
// Safari only allows auth popups while handling the original user gesture.
1542-
// Call into JS synchronously so the web OIDC flow can pre-open the window.
1543-
js.context.callMethod('setByName', [
1542+
// Use Future.sync so the JS call runs synchronously (pre-opening the OIDC
1543+
// window) while any interop error still surfaces as a Future error.
1544+
return Future.sync(() => js.context.callMethod('setByName', [
15441545
'account_auth',
15451546
jsonEncode({'op': op, 'remember': rememberMe})
1546-
]);
1547-
return Future.value();
1547+
]));
15481548
}
15491549

15501550
Future<void> mainAccountAuthCancel({dynamic hint}) {

0 commit comments

Comments
 (0)