Skip to content

Commit 6899226

Browse files
committed
ux: add option to open statistics screen from start view on macOS
Signed-off-by: Tommy van der Vorst <tommy@pixelspark.nl>
1 parent 43597b4 commit 6899226

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

Sushitrain/StartView.swift

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ struct StartView: View {
279279
@ObservedObject var backgroundManager: BackgroundManager
280280
#endif
281281

282+
#if os(macOS)
283+
@Environment(\.openWindow) private var openWindow
284+
#endif
285+
282286
@State private var qrCodeShown = false
283287
@State private var showWaitScreen: Bool = false
284288
@State private var showAddresses = false
@@ -300,8 +304,8 @@ struct StartView: View {
300304
Form {
301305
Section {
302306
OverallStatusView()
303-
#if os(iOS)
304-
.contextMenu {
307+
.contextMenu {
308+
#if os(iOS)
305309
if !self.appState.isFinished {
306310
if #available(iOS 26, *) {
307311
self.continueInBackgroundMenu(untilFinished: true)
@@ -316,8 +320,14 @@ struct StartView: View {
316320
if #available(iOS 26, *) {
317321
self.continueInBackgroundMenu(untilFinished: false)
318322
}
319-
}
320-
#endif
323+
#endif
324+
325+
#if os(macOS)
326+
Button("Statistics...") {
327+
openWindow(id: "stats")
328+
}
329+
#endif
330+
}
321331

322332
#if os(iOS)
323333
if backgroundManager.runningContinuedTask != nil {

0 commit comments

Comments
 (0)