From 852c67e74b1d7a0c322b1a9075603b18082bc46f Mon Sep 17 00:00:00 2001 From: tisfeng Date: Tue, 10 Dec 2024 21:14:36 +0800 Subject: [PATCH] fix: alert text show up to 1000 (#744) --- .../ServiceConfigurationSecretSectionView.swift | 2 +- Easydict/Swift/View/SettingView/Tabs/TabView/AboutTab.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Easydict/Swift/View/SettingView/Tabs/ServiceConfigurationView/ServiceConfigurationSecretSectionView.swift b/Easydict/Swift/View/SettingView/Tabs/ServiceConfigurationView/ServiceConfigurationSecretSectionView.swift index 8abd508fc..1b7c52877 100644 --- a/Easydict/Swift/View/SettingView/Tabs/ServiceConfigurationView/ServiceConfigurationSecretSectionView.swift +++ b/Easydict/Swift/View/SettingView/Tabs/ServiceConfigurationView/ServiceConfigurationSecretSectionView.swift @@ -88,7 +88,7 @@ struct ServiceConfigurationSecretSectionView: View { viewModel.reset() } } message: { - Text(viewModel.errorMessage) + Text(viewModel.errorMessage.prefix(1000)) } .onDisappear { viewModel.invalidate() diff --git a/Easydict/Swift/View/SettingView/Tabs/TabView/AboutTab.swift b/Easydict/Swift/View/SettingView/Tabs/TabView/AboutTab.swift index 8495d2b5e..5f00f0471 100644 --- a/Easydict/Swift/View/SettingView/Tabs/TabView/AboutTab.swift +++ b/Easydict/Swift/View/SettingView/Tabs/TabView/AboutTab.swift @@ -26,8 +26,6 @@ struct SettingsAboutTab: View { struct AboutTab: View { // MARK: Internal - @Environment(\.openWindow) private var openWindow - var body: some View { VortexViewReader { proxy in GeometryReader { geometry in @@ -119,6 +117,8 @@ struct AboutTab: View { // MARK: Private + @Environment(\.openWindow) private var openWindow + private var appName: String { Bundle.main.infoDictionary?["CFBundleName"] as? String ?? "" }