avoid currentUser call more than once when initializing app

This commit is contained in:
rustdesk
2023-06-22 23:19:26 +08:00
parent 5831db260f
commit 20db4bed01
3 changed files with 9 additions and 6 deletions

View File

@@ -33,9 +33,6 @@ int? kWindowId;
WindowType? kWindowType;
late List<String> kBootArgs;
/// Uni links.
StreamSubscription? _uniLinkSubscription;
Future<void> main(List<String> args) async {
WidgetsFlutterBinding.ensureInitialized();
debugPrint("launch args: $args");
@@ -123,7 +120,6 @@ void runMainApp(bool startService) async {
// trigger connection status updater
await bind.mainCheckConnectStatus();
if (startService) {
// await windowManager.ensureInitialized();
gFFI.serverModel.startService();
bind.pluginSyncUi(syncTo: kAppTypeMain);
bind.pluginListReload();
@@ -229,7 +225,7 @@ void runConnectionManagerScreen(bool hide) async {
await showCmWindow(isStartup: true);
}
// Start the uni links handler and redirect links to Native, not for Flutter.
_uniLinkSubscription = listenUniLinks(handleByFlutter: false);
listenUniLinks(handleByFlutter: false);
}
showCmWindow({bool isStartup = false}) async {