From 8480bc3bb600d6bdc69938b5d710f3a6c6d66532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sat, 11 Apr 2026 12:04:48 +0800 Subject: [PATCH] Fix deprecated check error --- .../Views/Abstract/GlobalChecksModifier.swift | 12 +++------ .../Views/Tools/TailscalePeerView.swift | 26 +++++++++---------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/ApplicationLibrary/Views/Abstract/GlobalChecksModifier.swift b/ApplicationLibrary/Views/Abstract/GlobalChecksModifier.swift index 340529f..bea5a54 100644 --- a/ApplicationLibrary/Views/Abstract/GlobalChecksModifier.swift +++ b/ApplicationLibrary/Views/Abstract/GlobalChecksModifier.swift @@ -165,16 +165,10 @@ public struct GlobalChecksModifier: ViewModifier { let disableWarnings = await SharedPreferences.disableDeprecatedWarnings.get() guard !disableWarnings else { return } - do { - let reports = try LibboxNewStandaloneCommandClient()!.getDeprecatedNotes() - if reports.hasNext() { - await MainActor.run { - showNextDeprecatedNote(reports) - } - } - } catch { + guard let reports = try? LibboxNewStandaloneCommandClient()!.getDeprecatedNotes() else { return } + if reports.hasNext() { await MainActor.run { - alert = AlertState(action: "check deprecated notes", error: error) + showNextDeprecatedNote(reports) } } } diff --git a/ApplicationLibrary/Views/Tools/TailscalePeerView.swift b/ApplicationLibrary/Views/Tools/TailscalePeerView.swift index eda5f0e..bd9ff0e 100644 --- a/ApplicationLibrary/Views/Tools/TailscalePeerView.swift +++ b/ApplicationLibrary/Views/Tools/TailscalePeerView.swift @@ -182,20 +182,20 @@ public struct TailscalePeerView: View { } Spacer() #if !os(tvOS) - Button { - copyToClipboard(address) - } label: { - if copiedAddress == address { - Image(systemName: "checkmark") - .foregroundStyle(.secondary) - } else { - Image(systemName: "doc.on.doc") - .foregroundStyle(.blue) + Button { + copyToClipboard(address) + } label: { + if copiedAddress == address { + Image(systemName: "checkmark") + .foregroundStyle(.secondary) + } else { + Image(systemName: "doc.on.doc") + .foregroundStyle(.blue) + } } - } - #if os(macOS) - .buttonStyle(.plain) - #endif + #if os(macOS) + .buttonStyle(.plain) + #endif #endif } }