Browse Source

bug fixed

nttest 6 years ago
parent
commit
e3958e2c4b
2 changed files with 7 additions and 3 deletions
  1. 6 3
      src/AppModels/Vms/StartStopMineButtonViewModel.cs
  2. 1 0
      src/MinerClient/App.xaml.cs

+ 6 - 3
src/AppModels/Vms/StartStopMineButtonViewModel.cs

@@ -30,6 +30,12 @@ namespace NTMiner.Vms {
                     }
                 });
             });
+#if DEBUG
+                Write.DevTimeSpan($"耗时{Write.Stopwatch.ElapsedMilliseconds}毫秒 {this.GetType().Name}.ctor");
+#endif
+        }
+
+        public void AutoStart() {
             if (NTMinerRoot.IsAutoStart && !this.MinerProfile.IsMining) {
                 this.MinerProfile.IsMining = true;
                 int n = MinerProfile.AutoStartDelaySeconds;
@@ -53,9 +59,6 @@ namespace NTMiner.Vms {
                     }
                 });
             }
-#if DEBUG
-                Write.DevTimeSpan($"耗时{Write.Stopwatch.ElapsedMilliseconds}毫秒 {this.GetType().Name}.ctor");
-#endif
         }
 
         private string _btnStopText = "正在挖矿";

+ 1 - 0
src/MinerClient/App.xaml.cs

@@ -111,6 +111,7 @@ namespace NTMiner {
                             else {
                                 _appViewFactory.ShowMainWindow(isToggle: false);
                             }
+                            StartStopMineButtonViewModel.Instance.AutoStart();
                             AppContext.NotifyIcon = ExtendedNotifyIcon.Create("开源矿工", isMinerStudio: false);
                             splashWindow?.Close();
                         });