From 53d946667c51c53fe7d8a312954a138ac7da547a Mon Sep 17 00:00:00 2001 From: Nyvernn <30959088+Nyvernn@users.noreply.github.com> Date: Thu, 6 Aug 2026 18:48:21 +0800 Subject: [PATCH] fix(log): present export errors instead of dropping them --- EasyTier/Views/LogView.swift | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/EasyTier/Views/LogView.swift b/EasyTier/Views/LogView.swift index 16e72a1..915a42d 100644 --- a/EasyTier/Views/LogView.swift +++ b/EasyTier/Views/LogView.swift @@ -102,10 +102,16 @@ struct LogView: View { break } } - .alert(item: $tailer.errorMessage) { msg in - Alert(title: Text("common.error"), message: Text(msg.text)) - } - .alert(item: $exportErrorMessage) { msg in + // One alert for the view. Two of them stacked here does not reliably present both, and + // it was the second that lost: every export error, including "Log file not found.", + // was dropped without a trace and the share button looked dead. + .alert(item: Binding( + get: { tailer.errorMessage ?? exportErrorMessage }, + set: { _ in + tailer.errorMessage = nil + exportErrorMessage = nil + } + )) { msg in Alert(title: Text("common.error"), message: Text(msg.text)) } #if os(iOS)