Skip to content

Commit 5958c9c

Browse files
committed
修复初始化问题
1 parent fc07331 commit 5958c9c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

TimeControl/Data/Task.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public bool RunTask()
4040
{
4141
bool res = false;
4242
startTime = DateTime.Now;
43-
if (IsFocus&&(!isDeepFocus))
43+
if (IsFocus && (!isDeepFocus))
4444
{
4545
LockHelper.StartLock(Password.unlockPasswordHash, (int)Duration.TotalMinutes);
4646
EndTask();

TimeControl/Windows/ControlPanel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ public ControlPanel(bool hide)
2828
versionLabel.Text = $"版本:{Assembly.GetExecutingAssembly().GetName().Version}";
2929
InitializeSettings();
3030
this.hide = hide;
31+
if (!Directory.Exists(TCFile.BaseLocation))
32+
{
33+
Directory.CreateDirectory(TCFile.BaseLocation);
34+
}
3135
//Tasks
3236
ReadTasks();
3337
//Data recording
@@ -279,10 +283,6 @@ private void InitTitles()
279283

280284
private void StartMonitor()
281285
{
282-
if (!Directory.Exists(TCFile.BaseLocation))
283-
{
284-
Directory.CreateDirectory(TCFile.BaseLocation);
285-
}
286286
appController = new(usageBox, processMonitorTimer);
287287
if ((Directory.GetLastWriteTime(TCFile.TimeFileDirectory).ToString("yyyy-MM-dd")
288288
!= DateTime.Now.ToString("yyyy-MM-dd"))

0 commit comments

Comments
 (0)