Browse Source

[fix]修复合并错误

Destiny 1 year ago
parent
commit
6dea3ad84d
1 changed files with 11 additions and 19 deletions
  1. 11 19
      lib/module/splash/controller.dart

+ 11 - 19
lib/module/splash/controller.dart

@@ -89,29 +89,21 @@ class SplashController extends BaseController {
 
   isAgreePrivacyNextStep() {
     //判断是否有额外操作执行
-    final routeMap = DesktopShortcutUtils.getRouteMap();
-    if (routeMap != null) {
-      _dealExistData(routeMap);
+    if (DesktopShortcutUtils.getRouteMap() != null) {
+      final routeMap = DesktopShortcutUtils.getRouteMap();
+      if (routeMap?[LaunchAction.key] == LaunchAction.recordAudioAction) {
+        _goMain(Duration.zero, arguments: routeMap);
+      } else {
+        _goMain(Duration(seconds: splashDelayedTime));
+      }
     } else {
-      _normalGoMain();
+      _goMain(Duration(seconds: splashDelayedTime));
     }
   }
 
-  _dealExistData(Map<String, dynamic> routeMap) {
-    if (routeMap[LaunchAction.key] == LaunchAction.recordAudioAction) {
-      //录音
-      Get.offNamed(RoutePath.mainTab);
-      Get.toNamed(RoutePath.record);
-      DesktopShortcutUtils.clearRouteMap();
-    } else {
-      _normalGoMain();
-    }
-  }
-
-  void _normalGoMain() {
-    // registerIosDeeplink();
-    Timer(Duration(seconds: splashDelayedTime), () {
-      Get.offNamed(RoutePath.mainTab);
+  void _goMain(Duration delayTime, {Map<String, dynamic>? arguments}) {
+    Timer(delayTime, () {
+      Get.offNamed(RoutePath.mainTab, arguments: arguments);
     });
   }
 }