File tree Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -135,17 +135,25 @@ async Task ActivateAsync()
135
135
136
136
_ = MainWindow . Instance . InitializeApplicationAsync ( appActivationArguments . Data ) ;
137
137
}
138
-
139
- await AppLifecycleHelper . InitializeAppComponentsAsync ( ) ;
140
-
141
- if ( isStartupTask && isLeaveAppRunning )
138
+ else
142
139
{
143
- // Create a system tray icon when initialization is done
140
+ // Create a system tray icon
144
141
SystemTrayIcon = new SystemTrayIcon ( ) . Show ( ) ;
145
- App . Current . Exit ( ) ;
142
+
143
+ // Sleep current instance
144
+ Program . Pool = new ( 0 , 1 , $ "Files-{ ApplicationService . AppEnvironment } -Instance") ;
145
+
146
+ Thread . Yield ( ) ;
147
+
148
+ if ( Program . Pool . WaitOne ( ) )
149
+ {
150
+ // Resume the instance
151
+ Program . Pool . Dispose ( ) ;
152
+ Program . Pool = null ;
153
+ }
146
154
}
147
- else
148
- await AppLifecycleHelper . CheckAppUpdate ( ) ;
155
+
156
+ await AppLifecycleHelper . InitializeAppComponentsAsync ( ) ;
149
157
}
150
158
}
151
159
Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ await Task.WhenAll(
52
52
53
53
FileTagsHelper . UpdateTagsDb ( ) ;
54
54
55
+ await CheckAppUpdate ( ) ;
56
+
55
57
static Task OptionalTaskAsync ( Task task , bool condition )
56
58
{
57
59
if ( condition )
You can’t perform that action at this time.
0 commit comments