Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8d8a21a

Browse files
committed
use async let
1 parent56b3a88 commit8d8a21a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

‎Coder Desktop/Coder Desktop/Coder_DesktopApp.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,13 @@ class AppDelegate: NSObject, NSApplicationDelegate {
6969
// or return `.terminateNow`
7070
func applicationShouldTerminate(_:NSApplication)->NSApplication.TerminateReply{
7171
Task{
72-
letvpnStop=Task{
73-
if!state.stopVPNOnQuit{
74-
await vpn.stop()
72+
asyncletvpnTask:Void={
73+
ifawait !self.state.stopVPNOnQuit{
74+
awaitself.vpn.stop()
7575
}
76-
}
77-
letfileSyncStop=Task{
78-
await fileSyncDaemon.stop()
79-
}
80-
_=await(vpnStop.value, fileSyncStop.value)
76+
}()
77+
asyncletfileSyncTask:Void=self.fileSyncDaemon.stop()
78+
_=await(vpnTask, fileSyncTask)
8179
NSApp.reply(toApplicationShouldTerminate:true)
8280
}
8381
return.terminateLater

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp