mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-02-23 21:16:22 +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))
|
async let featuredTags: [FeaturedTag] = client.get(endpoint: Accounts.featuredTags(id: accountId))
|
||||||
if client.isAuth && !isCurrentUser {
|
if client.isAuth && !isCurrentUser {
|
||||||
async let relationships: [Relationship] = client.get(endpoint: Accounts.relationships(ids: [accountId]))
|
async let relationships: [Relationship] = client.get(endpoint: Accounts.relationships(ids: [accountId]))
|
||||||
return try await .init(account: account,
|
do {
|
||||||
featuredTags: featuredTags,
|
return try await .init(account: account,
|
||||||
relationships: relationships)
|
featuredTags: featuredTags,
|
||||||
|
relationships: relationships)
|
||||||
|
} catch {
|
||||||
|
return try await .init(account: account,
|
||||||
|
featuredTags: [],
|
||||||
|
relationships: relationships)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return try await .init(account: account,
|
return try await .init(account: account,
|
||||||
featuredTags: featuredTags,
|
featuredTags: featuredTags,
|
||||||
|
|
|
@ -9,6 +9,7 @@ struct StatusEditorAccessoryView: View {
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@EnvironmentObject private var preferences: UserPreferences
|
||||||
@EnvironmentObject private var theme: Theme
|
@EnvironmentObject private var theme: Theme
|
||||||
@EnvironmentObject private var currentInstance: CurrentInstance
|
@EnvironmentObject private var currentInstance: CurrentInstance
|
||||||
|
@Environment(\.colorScheme) private var colorScheme
|
||||||
|
|
||||||
@FocusState<Bool>.Binding var isSpoilerTextFocused: Bool
|
@FocusState<Bool>.Binding var isSpoilerTextFocused: Bool
|
||||||
@ObservedObject var viewModel: StatusEditorViewModel
|
@ObservedObject var viewModel: StatusEditorViewModel
|
||||||
|
@ -30,7 +31,7 @@ struct StatusEditorAccessoryView: View {
|
||||||
if viewModel.isMediasLoading {
|
if viewModel.isMediasLoading {
|
||||||
ProgressView()
|
ProgressView()
|
||||||
} else {
|
} else {
|
||||||
Image(systemName: "photo.fill.on.rectangle.fill")
|
Image(systemName: "photo.on.rectangle.angled")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.accessibilityLabel("accessibility.editor.button.attach-photo")
|
.accessibilityLabel("accessibility.editor.button.attach-photo")
|
||||||
|
@ -70,7 +71,10 @@ struct StatusEditorAccessoryView: View {
|
||||||
Button {
|
Button {
|
||||||
isCustomEmojisSheetDisplay = true
|
isCustomEmojisSheetDisplay = true
|
||||||
} label: {
|
} 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")
|
.accessibilityLabel("accessibility.editor.button.custom-emojis")
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,10 +170,8 @@ public struct StatusEditorView: View {
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private var languageConfirmationDialog: some View {
|
private var languageConfirmationDialog: some View {
|
||||||
if let dialogVals = viewModel.languageConfirmationDialogLanguages,
|
if let (detected: detected, selected: selected) = viewModel.languageConfirmationDialogLanguages,
|
||||||
let detected = dialogVals["detected"],
|
|
||||||
let detectedLong = Locale.current.localizedString(forLanguageCode: detected),
|
let detectedLong = Locale.current.localizedString(forLanguageCode: detected),
|
||||||
let selected = dialogVals["selected"],
|
|
||||||
let selectedLong = Locale.current.localizedString(forLanguageCode: selected)
|
let selectedLong = Locale.current.localizedString(forLanguageCode: selected)
|
||||||
{
|
{
|
||||||
Button("status.editor.language-select.confirmation.detected-\(detectedLong)") {
|
Button("status.editor.language-select.confirmation.detected-\(detectedLong)") {
|
||||||
|
|
|
@ -15,7 +15,7 @@ public class StatusEditorViewModel: NSObject, ObservableObject {
|
||||||
var currentAccount: Account?
|
var currentAccount: Account?
|
||||||
var theme: Theme?
|
var theme: Theme?
|
||||||
var preferences: UserPreferences?
|
var preferences: UserPreferences?
|
||||||
var languageConfirmationDialogLanguages: [String: String]?
|
var languageConfirmationDialogLanguages: (detected: String, selected: String)?
|
||||||
|
|
||||||
var textView: UITextView? {
|
var textView: UITextView? {
|
||||||
didSet {
|
didSet {
|
||||||
|
@ -151,8 +151,7 @@ public class StatusEditorViewModel: NSObject, ObservableObject {
|
||||||
selectedLanguage != "",
|
selectedLanguage != "",
|
||||||
selectedLanguage != detectedLang
|
selectedLanguage != detectedLang
|
||||||
{
|
{
|
||||||
languageConfirmationDialogLanguages = ["detected": detectedLang,
|
languageConfirmationDialogLanguages = (detected: detectedLang, selected: selectedLanguage)
|
||||||
"selected": selectedLanguage]
|
|
||||||
} else {
|
} else {
|
||||||
languageConfirmationDialogLanguages = nil
|
languageConfirmationDialogLanguages = nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue