mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-02-23 04:56:16 +00:00
Merge branch 'main' of https://github.com/Dimillian/IceCubesApp
This commit is contained in:
commit
c3c6899483
4 changed files with 18 additions and 11 deletions
|
@ -132,9 +132,15 @@ class AccountDetailViewModel: ObservableObject, StatusesFetcher {
|
|||
async let featuredTags: [FeaturedTag] = client.get(endpoint: Accounts.featuredTags(id: accountId))
|
||||
if client.isAuth && !isCurrentUser {
|
||||
async let relationships: [Relationship] = client.get(endpoint: Accounts.relationships(ids: [accountId]))
|
||||
return try await .init(account: account,
|
||||
featuredTags: featuredTags,
|
||||
relationships: relationships)
|
||||
do {
|
||||
return try await .init(account: account,
|
||||
featuredTags: featuredTags,
|
||||
relationships: relationships)
|
||||
} catch {
|
||||
return try await .init(account: account,
|
||||
featuredTags: [],
|
||||
relationships: relationships)
|
||||
}
|
||||
}
|
||||
return try await .init(account: account,
|
||||
featuredTags: featuredTags,
|
||||
|
|
|
@ -9,6 +9,7 @@ struct StatusEditorAccessoryView: View {
|
|||
@EnvironmentObject private var preferences: UserPreferences
|
||||
@EnvironmentObject private var theme: Theme
|
||||
@EnvironmentObject private var currentInstance: CurrentInstance
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
|
||||
@FocusState<Bool>.Binding var isSpoilerTextFocused: Bool
|
||||
@ObservedObject var viewModel: StatusEditorViewModel
|
||||
|
@ -30,7 +31,7 @@ struct StatusEditorAccessoryView: View {
|
|||
if viewModel.isMediasLoading {
|
||||
ProgressView()
|
||||
} else {
|
||||
Image(systemName: "photo.fill.on.rectangle.fill")
|
||||
Image(systemName: "photo.on.rectangle.angled")
|
||||
}
|
||||
}
|
||||
.accessibilityLabel("accessibility.editor.button.attach-photo")
|
||||
|
@ -70,7 +71,10 @@ struct StatusEditorAccessoryView: View {
|
|||
Button {
|
||||
isCustomEmojisSheetDisplay = true
|
||||
} label: {
|
||||
Image(systemName: "face.smiling.inverse")
|
||||
// This is a workaround for an apparent bug in the `face.smiling` SF Symbol.
|
||||
// See https://github.com/Dimillian/IceCubesApp/issues/1193
|
||||
let customEmojiSheetIconName = colorScheme == .light ? "face.smiling" : "face.smiling.inverse"
|
||||
Image(systemName: customEmojiSheetIconName)
|
||||
}
|
||||
.accessibilityLabel("accessibility.editor.button.custom-emojis")
|
||||
}
|
||||
|
|
|
@ -170,10 +170,8 @@ public struct StatusEditorView: View {
|
|||
|
||||
@ViewBuilder
|
||||
private var languageConfirmationDialog: some View {
|
||||
if let dialogVals = viewModel.languageConfirmationDialogLanguages,
|
||||
let detected = dialogVals["detected"],
|
||||
if let (detected: detected, selected: selected) = viewModel.languageConfirmationDialogLanguages,
|
||||
let detectedLong = Locale.current.localizedString(forLanguageCode: detected),
|
||||
let selected = dialogVals["selected"],
|
||||
let selectedLong = Locale.current.localizedString(forLanguageCode: selected)
|
||||
{
|
||||
Button("status.editor.language-select.confirmation.detected-\(detectedLong)") {
|
||||
|
|
|
@ -15,7 +15,7 @@ public class StatusEditorViewModel: NSObject, ObservableObject {
|
|||
var currentAccount: Account?
|
||||
var theme: Theme?
|
||||
var preferences: UserPreferences?
|
||||
var languageConfirmationDialogLanguages: [String: String]?
|
||||
var languageConfirmationDialogLanguages: (detected: String, selected: String)?
|
||||
|
||||
var textView: UITextView? {
|
||||
didSet {
|
||||
|
@ -151,8 +151,7 @@ public class StatusEditorViewModel: NSObject, ObservableObject {
|
|||
selectedLanguage != "",
|
||||
selectedLanguage != detectedLang
|
||||
{
|
||||
languageConfirmationDialogLanguages = ["detected": detectedLang,
|
||||
"selected": selectedLanguage]
|
||||
languageConfirmationDialogLanguages = (detected: detectedLang, selected: selectedLanguage)
|
||||
} else {
|
||||
languageConfirmationDialogLanguages = nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue