mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-06-29 10:30:32 +00:00
UserPreferences -> Observable
This commit is contained in:
parent
fd09276d49
commit
6c23569d15
|
@ -113,7 +113,7 @@ extension View {
|
||||||
|
|
||||||
func withEnvironments() -> some View {
|
func withEnvironments() -> some View {
|
||||||
environment(CurrentAccount.shared)
|
environment(CurrentAccount.shared)
|
||||||
.environmentObject(UserPreferences.shared)
|
.environment(UserPreferences.shared)
|
||||||
.environment(CurrentInstance.shared)
|
.environment(CurrentInstance.shared)
|
||||||
.environment(Theme.shared)
|
.environment(Theme.shared)
|
||||||
.environment(AppAccountsManager.shared)
|
.environment(AppAccountsManager.shared)
|
||||||
|
|
|
@ -18,7 +18,7 @@ struct IceCubesApp: App {
|
||||||
@State private var appAccountsManager = AppAccountsManager.shared
|
@State private var appAccountsManager = AppAccountsManager.shared
|
||||||
@State private var currentInstance = CurrentInstance.shared
|
@State private var currentInstance = CurrentInstance.shared
|
||||||
@State private var currentAccount = CurrentAccount.shared
|
@State private var currentAccount = CurrentAccount.shared
|
||||||
@StateObject private var userPreferences = UserPreferences.shared
|
@State private var userPreferences = UserPreferences.shared
|
||||||
@State private var pushNotificationsService = PushNotificationsService.shared
|
@State private var pushNotificationsService = PushNotificationsService.shared
|
||||||
@State private var watcher = StreamWatcher()
|
@State private var watcher = StreamWatcher()
|
||||||
@State private var quickLook = QuickLook()
|
@State private var quickLook = QuickLook()
|
||||||
|
@ -48,7 +48,7 @@ struct IceCubesApp: App {
|
||||||
.environment(quickLook)
|
.environment(quickLook)
|
||||||
.environment(currentAccount)
|
.environment(currentAccount)
|
||||||
.environment(currentInstance)
|
.environment(currentInstance)
|
||||||
.environmentObject(userPreferences)
|
.environment(userPreferences)
|
||||||
.environment(theme)
|
.environment(theme)
|
||||||
.environment(watcher)
|
.environment(watcher)
|
||||||
.environment(pushNotificationsService)
|
.environment(pushNotificationsService)
|
||||||
|
|
|
@ -13,7 +13,7 @@ extension View {
|
||||||
@MainActor
|
@MainActor
|
||||||
private struct SafariRouter: ViewModifier {
|
private struct SafariRouter: ViewModifier {
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(RouterPath.self) private var routerPath
|
@Environment(RouterPath.self) private var routerPath
|
||||||
|
|
||||||
@State private var safariManager = InAppSafariManager()
|
@State private var safariManager = InAppSafariManager()
|
||||||
|
|
|
@ -5,12 +5,13 @@ import Env
|
||||||
import Models
|
import Models
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct SideBarView<Content: View>: View {
|
struct SideBarView<Content: View>: View {
|
||||||
@Environment(AppAccountsManager.self) private var appAccounts
|
@Environment(AppAccountsManager.self) private var appAccounts
|
||||||
@Environment(CurrentAccount.self) private var currentAccount
|
@Environment(CurrentAccount.self) private var currentAccount
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@Environment(StreamWatcher.self) private var watcher
|
@Environment(StreamWatcher.self) private var watcher
|
||||||
@EnvironmentObject private var userPreferences: UserPreferences
|
@Environment(UserPreferences.self) private var userPreferences
|
||||||
@Environment(RouterPath.self) private var routerPath
|
@Environment(RouterPath.self) private var routerPath
|
||||||
|
|
||||||
@Binding var selectedTab: Tab
|
@Binding var selectedTab: Tab
|
||||||
|
|
|
@ -7,9 +7,10 @@ import Network
|
||||||
import Shimmer
|
import Shimmer
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct ExploreTab: View {
|
struct ExploreTab: View {
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(CurrentAccount.self) private var currentAccount
|
@Environment(CurrentAccount.self) private var currentAccount
|
||||||
@Environment(Client.self) private var client
|
@Environment(Client.self) private var client
|
||||||
@State private var routerPath = RouterPath()
|
@State private var routerPath = RouterPath()
|
||||||
|
|
|
@ -7,6 +7,7 @@ import Notifications
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import Timeline
|
import Timeline
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct NotificationsTab: View {
|
struct NotificationsTab: View {
|
||||||
@Environment(\.isSecondaryColumn) private var isSecondaryColumn: Bool
|
@Environment(\.isSecondaryColumn) private var isSecondaryColumn: Bool
|
||||||
@Environment(\.scenePhase) private var scenePhase
|
@Environment(\.scenePhase) private var scenePhase
|
||||||
|
@ -16,7 +17,7 @@ struct NotificationsTab: View {
|
||||||
@Environment(StreamWatcher.self) private var watcher
|
@Environment(StreamWatcher.self) private var watcher
|
||||||
@Environment(AppAccountsManager.self) private var appAccount
|
@Environment(AppAccountsManager.self) private var appAccount
|
||||||
@Environment(CurrentAccount.self) private var currentAccount
|
@Environment(CurrentAccount.self) private var currentAccount
|
||||||
@EnvironmentObject private var userPreferences: UserPreferences
|
@Environment(UserPreferences.self) private var userPreferences
|
||||||
@Environment(PushNotificationsService.self) private var pushNotificationsService
|
@Environment(PushNotificationsService.self) private var pushNotificationsService
|
||||||
@State private var routerPath = RouterPath()
|
@State private var routerPath = RouterPath()
|
||||||
@Binding var popToRootTab: Tab
|
@Binding var popToRootTab: Tab
|
||||||
|
|
|
@ -7,11 +7,13 @@ import NukeUI
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import UserNotifications
|
import UserNotifications
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct ContentSettingsView: View {
|
struct ContentSettingsView: View {
|
||||||
@EnvironmentObject private var userPreferences: UserPreferences
|
@Environment(UserPreferences.self) private var userPreferences
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
@Bindable var userPreferences = userPreferences
|
||||||
Form {
|
Form {
|
||||||
Section("settings.content.boosts") {
|
Section("settings.content.boosts") {
|
||||||
Toggle(isOn: $userPreferences.suppressDupeReblogs) {
|
Toggle(isOn: $userPreferences.suppressDupeReblogs) {
|
||||||
|
|
|
@ -18,12 +18,13 @@ import SwiftUI
|
||||||
init() {}
|
init() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct DisplaySettingsView: View {
|
struct DisplaySettingsView: View {
|
||||||
typealias FontState = Theme.FontState
|
typealias FontState = Theme.FontState
|
||||||
|
|
||||||
@Environment(\.colorScheme) private var colorScheme
|
@Environment(\.colorScheme) private var colorScheme
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@EnvironmentObject private var userPreferences: UserPreferences
|
@Environment(UserPreferences.self) private var userPreferences
|
||||||
|
|
||||||
@State private var localValues = DisplaySettingsLocalValues()
|
@State private var localValues = DisplaySettingsLocalValues()
|
||||||
|
|
||||||
|
@ -180,6 +181,7 @@ struct DisplaySettingsView: View {
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private var layoutSection: some View {
|
private var layoutSection: some View {
|
||||||
@Bindable var theme = theme
|
@Bindable var theme = theme
|
||||||
|
@Bindable var userPreferences = userPreferences
|
||||||
Section("settings.display.section.display") {
|
Section("settings.display.section.display") {
|
||||||
Picker("settings.display.avatar.position", selection: $theme.avatarPosition) {
|
Picker("settings.display.avatar.position", selection: $theme.avatarPosition) {
|
||||||
ForEach(Theme.AvatarPosition.allCases, id: \.rawValue) { position in
|
ForEach(Theme.AvatarPosition.allCases, id: \.rawValue) { position in
|
||||||
|
@ -210,6 +212,7 @@ struct DisplaySettingsView: View {
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private var platformsSection: some View {
|
private var platformsSection: some View {
|
||||||
|
@Bindable var userPreferences = userPreferences
|
||||||
if UIDevice.current.userInterfaceIdiom == .phone {
|
if UIDevice.current.userInterfaceIdiom == .phone {
|
||||||
Section("iPhone") {
|
Section("iPhone") {
|
||||||
Toggle("settings.display.show-tab-label", isOn: $userPreferences.showiPhoneTabLabel)
|
Toggle("settings.display.show-tab-label", isOn: $userPreferences.showiPhoneTabLabel)
|
||||||
|
|
|
@ -4,11 +4,13 @@ import Models
|
||||||
import Status
|
import Status
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct HapticSettingsView: View {
|
struct HapticSettingsView: View {
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@EnvironmentObject private var userPreferences: UserPreferences
|
@Environment(UserPreferences.self) private var userPreferences
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
@Bindable var userPreferences = userPreferences
|
||||||
Form {
|
Form {
|
||||||
Section {
|
Section {
|
||||||
Toggle("settings.haptic.timeline", isOn: $userPreferences.hapticTimelineEnabled)
|
Toggle("settings.haptic.timeline", isOn: $userPreferences.hapticTimelineEnabled)
|
||||||
|
|
|
@ -9,11 +9,12 @@ import Nuke
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import Timeline
|
import Timeline
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct SettingsTabs: View {
|
struct SettingsTabs: View {
|
||||||
@Environment(\.dismiss) private var dismiss
|
@Environment(\.dismiss) private var dismiss
|
||||||
|
|
||||||
@Environment(PushNotificationsService.self) private var pushNotifications
|
@Environment(PushNotificationsService.self) private var pushNotifications
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(Client.self) private var client
|
@Environment(Client.self) private var client
|
||||||
@Environment(CurrentInstance.self) private var currentInstance
|
@Environment(CurrentInstance.self) private var currentInstance
|
||||||
@Environment(AppAccountsManager.self) private var appAccountsManager
|
@Environment(AppAccountsManager.self) private var appAccountsManager
|
||||||
|
@ -158,7 +159,9 @@ struct SettingsTabs: View {
|
||||||
.listRowBackground(theme.primaryBackgroundColor)
|
.listRowBackground(theme.primaryBackgroundColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ViewBuilder
|
||||||
private var otherSections: some View {
|
private var otherSections: some View {
|
||||||
|
@Bindable var preferences = preferences
|
||||||
Section("settings.section.other") {
|
Section("settings.section.other") {
|
||||||
if !ProcessInfo.processInfo.isiOSAppOnMac {
|
if !ProcessInfo.processInfo.isiOSAppOnMac {
|
||||||
Picker(selection: $preferences.preferredBrowser) {
|
Picker(selection: $preferences.preferredBrowser) {
|
||||||
|
|
|
@ -2,11 +2,13 @@ import DesignSystem
|
||||||
import Env
|
import Env
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct SwipeActionsSettingsView: View {
|
struct SwipeActionsSettingsView: View {
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@EnvironmentObject private var userPreferences: UserPreferences
|
@Environment(UserPreferences.self) private var userPreferences
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
@Bindable var userPreferences = userPreferences
|
||||||
Form {
|
Form {
|
||||||
Section {
|
Section {
|
||||||
Label("settings.swipeactions.status.leading", systemImage: "arrow.right")
|
Label("settings.swipeactions.status.leading", systemImage: "arrow.right")
|
||||||
|
|
|
@ -2,26 +2,19 @@ import DesignSystem
|
||||||
import Env
|
import Env
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct TranslationSettingsView: View {
|
struct TranslationSettingsView: View {
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
|
|
||||||
@State private var apiKey: String = ""
|
@State private var apiKey: String = ""
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Form {
|
Form {
|
||||||
Toggle(isOn: preferences.$alwaysUseDeepl) {
|
deepLToggle
|
||||||
Text("settings.translation.always-deepl")
|
|
||||||
}
|
|
||||||
.listRowBackground(theme.primaryBackgroundColor)
|
|
||||||
|
|
||||||
if preferences.alwaysUseDeepl {
|
if preferences.alwaysUseDeepl {
|
||||||
Section("settings.translation.user-api-key") {
|
Section("settings.translation.user-api-key") {
|
||||||
Picker("settings.translation.api-key-type", selection: $preferences.userDeeplAPIFree) {
|
deepLPicker
|
||||||
Text("DeepL API Free").tag(true)
|
|
||||||
Text("DeepL API Pro").tag(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
SecureField("settings.translation.user-api-key", text: $apiKey)
|
SecureField("settings.translation.user-api-key", text: $apiKey)
|
||||||
.textContentType(.password)
|
.textContentType(.password)
|
||||||
}
|
}
|
||||||
|
@ -40,14 +33,7 @@ struct TranslationSettingsView: View {
|
||||||
.listRowBackground(theme.primaryBackgroundColor)
|
.listRowBackground(theme.primaryBackgroundColor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
autoDetectSection
|
||||||
Section {
|
|
||||||
Toggle(isOn: preferences.$autoDetectPostLanguage) {
|
|
||||||
Text("settings.translation.auto-detect-post-language")
|
|
||||||
}
|
|
||||||
} footer: {
|
|
||||||
Text("settings.translation.auto-detect-post-language-footer")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.navigationTitle("settings.translation.navigation-title")
|
.navigationTitle("settings.translation.navigation-title")
|
||||||
.scrollContentBackground(.hidden)
|
.scrollContentBackground(.hidden)
|
||||||
|
@ -58,6 +44,36 @@ struct TranslationSettingsView: View {
|
||||||
.onAppear(perform: updatePrefs)
|
.onAppear(perform: updatePrefs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ViewBuilder
|
||||||
|
private var deepLToggle: some View {
|
||||||
|
@Bindable var preferences = preferences
|
||||||
|
Toggle(isOn: $preferences.alwaysUseDeepl) {
|
||||||
|
Text("settings.translation.always-deepl")
|
||||||
|
}
|
||||||
|
.listRowBackground(theme.primaryBackgroundColor)
|
||||||
|
}
|
||||||
|
|
||||||
|
@ViewBuilder
|
||||||
|
private var deepLPicker: some View {
|
||||||
|
@Bindable var preferences = preferences
|
||||||
|
Picker("settings.translation.api-key-type", selection: $preferences.userDeeplAPIFree) {
|
||||||
|
Text("DeepL API Free").tag(true)
|
||||||
|
Text("DeepL API Pro").tag(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ViewBuilder
|
||||||
|
private var autoDetectSection: some View {
|
||||||
|
@Bindable var preferences = preferences
|
||||||
|
Section {
|
||||||
|
Toggle(isOn: $preferences.autoDetectPostLanguage) {
|
||||||
|
Text("settings.translation.auto-detect-post-language")
|
||||||
|
}
|
||||||
|
} footer: {
|
||||||
|
Text("settings.translation.auto-detect-post-language-footer")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private func writeNewValue() {
|
private func writeNewValue() {
|
||||||
writeNewValue(value: apiKey)
|
writeNewValue(value: apiKey)
|
||||||
}
|
}
|
||||||
|
@ -82,6 +98,6 @@ struct TranslationSettingsView: View {
|
||||||
struct TranslationSettingsView_Previews: PreviewProvider {
|
struct TranslationSettingsView_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
TranslationSettingsView()
|
TranslationSettingsView()
|
||||||
.environmentObject(UserPreferences.shared)
|
.environment(UserPreferences.shared)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,10 +7,11 @@ import NukeUI
|
||||||
import Shimmer
|
import Shimmer
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct AddRemoteTimelineView: View {
|
struct AddRemoteTimelineView: View {
|
||||||
@Environment(\.dismiss) private var dismiss
|
@Environment(\.dismiss) private var dismiss
|
||||||
|
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
|
|
||||||
@State private var instanceName: String = ""
|
@State private var instanceName: String = ""
|
||||||
|
|
|
@ -7,10 +7,11 @@ import NukeUI
|
||||||
import Shimmer
|
import Shimmer
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct EditTagGroupView: View {
|
struct EditTagGroupView: View {
|
||||||
@Environment(\.dismiss) private var dismiss
|
@Environment(\.dismiss) private var dismiss
|
||||||
|
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
|
|
||||||
@State private var title: String = ""
|
@State private var title: String = ""
|
||||||
|
|
|
@ -7,11 +7,12 @@ import Network
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import Timeline
|
import Timeline
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct TimelineTab: View {
|
struct TimelineTab: View {
|
||||||
@Environment(AppAccountsManager.self) private var appAccount
|
@Environment(AppAccountsManager.self) private var appAccount
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@Environment(CurrentAccount.self) private var currentAccount
|
@Environment(CurrentAccount.self) private var currentAccount
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(Client.self) private var client
|
@Environment(Client.self) private var client
|
||||||
@State private var routerPath = RouterPath()
|
@State private var routerPath = RouterPath()
|
||||||
@Binding var popToRootTab: Tab
|
@Binding var popToRootTab: Tab
|
||||||
|
|
|
@ -27,7 +27,7 @@ class ShareViewController: UIViewController {
|
||||||
if let item = extensionContext?.inputItems.first as? NSExtensionItem {
|
if let item = extensionContext?.inputItems.first as? NSExtensionItem {
|
||||||
if let attachments = item.attachments {
|
if let attachments = item.attachments {
|
||||||
let view = StatusEditorView(mode: .shareExtension(items: attachments))
|
let view = StatusEditorView(mode: .shareExtension(items: attachments))
|
||||||
.environmentObject(UserPreferences.shared)
|
.environment(UserPreferences.shared)
|
||||||
.environment(appAccountsManager)
|
.environment(appAccountsManager)
|
||||||
.environment(client)
|
.environment(client)
|
||||||
.environment(account)
|
.environment(account)
|
||||||
|
|
|
@ -6,7 +6,7 @@ public struct AccountDetailContextMenu: View {
|
||||||
@Environment(Client.self) private var client
|
@Environment(Client.self) private var client
|
||||||
@Environment(RouterPath.self) private var routerPath
|
@Environment(RouterPath.self) private var routerPath
|
||||||
@Environment(CurrentInstance.self) private var currentInstance
|
@Environment(CurrentInstance.self) private var currentInstance
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
|
|
||||||
var viewModel: AccountDetailViewModel
|
var viewModel: AccountDetailViewModel
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ import Shimmer
|
||||||
import Status
|
import Status
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
public struct AccountDetailView: View {
|
public struct AccountDetailView: View {
|
||||||
@Environment(\.openURL) private var openURL
|
@Environment(\.openURL) private var openURL
|
||||||
@Environment(\.redactionReasons) private var reasons
|
@Environment(\.redactionReasons) private var reasons
|
||||||
|
@ -14,7 +15,7 @@ public struct AccountDetailView: View {
|
||||||
@Environment(StreamWatcher.self) private var watcher
|
@Environment(StreamWatcher.self) private var watcher
|
||||||
@Environment(CurrentAccount.self) private var currentAccount
|
@Environment(CurrentAccount.self) private var currentAccount
|
||||||
@Environment(CurrentInstance.self) private var currentInstance
|
@Environment(CurrentInstance.self) private var currentInstance
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@Environment(Client.self) private var client
|
@Environment(Client.self) private var client
|
||||||
@Environment(RouterPath.self) private var routerPath
|
@Environment(RouterPath.self) private var routerPath
|
||||||
|
|
|
@ -4,6 +4,7 @@ import Models
|
||||||
import Network
|
import Network
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
public struct FiltersListView: View {
|
public struct FiltersListView: View {
|
||||||
@Environment(\.dismiss) private var dismiss
|
@Environment(\.dismiss) private var dismiss
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,12 @@ import EmojiText
|
||||||
import Env
|
import Env
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
public struct AppAccountView: View {
|
public struct AppAccountView: View {
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@Environment(RouterPath.self) private var routerPath
|
@Environment(RouterPath.self) private var routerPath
|
||||||
@Environment(AppAccountsManager.self) private var appAccounts
|
@Environment(AppAccountsManager.self) private var appAccounts
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
|
|
||||||
@State var viewModel: AppAccountViewModel
|
@State var viewModel: AppAccountViewModel
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,9 @@ import DesignSystem
|
||||||
import Env
|
import Env
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
public struct AppAccountsSelectorView: View {
|
public struct AppAccountsSelectorView: View {
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(CurrentAccount.self) private var currentAccount
|
@Environment(CurrentAccount.self) private var currentAccount
|
||||||
@Environment(AppAccountsManager.self) private var appAccounts
|
@Environment(AppAccountsManager.self) private var appAccounts
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
|
|
|
@ -5,8 +5,9 @@ import Network
|
||||||
import Shimmer
|
import Shimmer
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
public struct ConversationsListView: View {
|
public struct ConversationsListView: View {
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(RouterPath.self) private var routerPath
|
@Environment(RouterPath.self) private var routerPath
|
||||||
@Environment(StreamWatcher.self) private var watcher
|
@Environment(StreamWatcher.self) private var watcher
|
||||||
@Environment(Client.self) private var client
|
@Environment(Client.self) private var client
|
||||||
|
|
|
@ -55,7 +55,7 @@ public struct StatusEditorToolbarItem: ToolbarContent {
|
||||||
@MainActor
|
@MainActor
|
||||||
public struct SecondaryColumnToolbarItem: ToolbarContent {
|
public struct SecondaryColumnToolbarItem: ToolbarContent {
|
||||||
@Environment(\.isSecondaryColumn) private var isSecondaryColumn
|
@Environment(\.isSecondaryColumn) private var isSecondaryColumn
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
|
|
||||||
public init() {}
|
public init() {}
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,8 @@ import Network
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
public class UserPreferences: ObservableObject {
|
@Observable public class UserPreferences {
|
||||||
public static let sharedDefault = UserDefaults(suiteName: "group.com.thomasricouard.IceCubesApp")
|
class Storage {
|
||||||
public static let shared = UserPreferences()
|
|
||||||
|
|
||||||
private var client: Client?
|
|
||||||
|
|
||||||
@AppStorage("remote_local_timeline") public var remoteLocalTimelines: [String] = []
|
@AppStorage("remote_local_timeline") public var remoteLocalTimelines: [String] = []
|
||||||
@AppStorage("tag_groups") public var tagGroups: [TagGroup] = []
|
@AppStorage("tag_groups") public var tagGroups: [TagGroup] = []
|
||||||
@AppStorage("preferred_browser") public var preferredBrowser: PreferredBrowser = .inAppSafari
|
@AppStorage("preferred_browser") public var preferredBrowser: PreferredBrowser = .inAppSafari
|
||||||
|
@ -59,6 +55,197 @@ public class UserPreferences: ObservableObject {
|
||||||
|
|
||||||
@AppStorage("share-button-behavior") public var shareButtonBehavior: PreferredShareButtonBehavior = .linkAndText
|
@AppStorage("share-button-behavior") public var shareButtonBehavior: PreferredShareButtonBehavior = .linkAndText
|
||||||
|
|
||||||
|
init() { }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static let sharedDefault = UserDefaults(suiteName: "group.com.thomasricouard.IceCubesApp")
|
||||||
|
public static let shared = UserPreferences()
|
||||||
|
private let storage = Storage()
|
||||||
|
|
||||||
|
private var client: Client?
|
||||||
|
|
||||||
|
public var remoteLocalTimelines: [String] {
|
||||||
|
didSet {
|
||||||
|
storage.remoteLocalTimelines = remoteLocalTimelines
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var tagGroups: [TagGroup] {
|
||||||
|
didSet {
|
||||||
|
storage.tagGroups = tagGroups
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var preferredBrowser: PreferredBrowser {
|
||||||
|
didSet {
|
||||||
|
storage.preferredBrowser = preferredBrowser
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var draftsPosts: [String] {
|
||||||
|
didSet {
|
||||||
|
storage.draftsPosts = draftsPosts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var showTranslateButton: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.showTranslateButton = showTranslateButton
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var isOpenAIEnabled: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.isOpenAIEnabled = isOpenAIEnabled
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var recentlyUsedLanguages: [String] {
|
||||||
|
didSet {
|
||||||
|
storage.recentlyUsedLanguages = recentlyUsedLanguages
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var isSocialKeyboardEnabled: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.isSocialKeyboardEnabled = isSocialKeyboardEnabled
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var useInstanceContentSettings: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.useInstanceContentSettings = useInstanceContentSettings
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var appAutoExpandSpoilers: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.appAutoExpandSpoilers = appAutoExpandSpoilers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var appAutoExpandMedia: ServerPreferences.AutoExpandMedia {
|
||||||
|
didSet {
|
||||||
|
storage.appAutoExpandMedia = appAutoExpandMedia
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var appDefaultPostVisibility: Models.Visibility {
|
||||||
|
didSet {
|
||||||
|
storage.appDefaultPostVisibility = appDefaultPostVisibility
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var appDefaultReplyVisibility: Models.Visibility {
|
||||||
|
didSet {
|
||||||
|
storage.appDefaultReplyVisibility = appDefaultReplyVisibility
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var appDefaultPostsSensitive: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.appDefaultPostsSensitive = appDefaultPostsSensitive
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var autoPlayVideo: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.autoPlayVideo = autoPlayVideo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var alwaysUseDeepl: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.alwaysUseDeepl = alwaysUseDeepl
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var userDeeplAPIFree: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.userDeeplAPIFree = userDeeplAPIFree
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var autoDetectPostLanguage: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.autoDetectPostLanguage = autoDetectPostLanguage
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var suppressDupeReblogs: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.suppressDupeReblogs = suppressDupeReblogs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var inAppBrowserReaderView: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.inAppBrowserReaderView = inAppBrowserReaderView
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var hapticTabSelectionEnabled: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.hapticTabSelectionEnabled = hapticTabSelectionEnabled
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var hapticTimelineEnabled: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.hapticTimelineEnabled = hapticTimelineEnabled
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var hapticButtonPressEnabled: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.hapticButtonPressEnabled = hapticButtonPressEnabled
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var soundEffectEnabled: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.soundEffectEnabled = soundEffectEnabled
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var showiPhoneTabLabel: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.showiPhoneTabLabel = showiPhoneTabLabel
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var showAltTextForMedia: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.showAltTextForMedia = showAltTextForMedia
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var showiPadSecondaryColumn: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.showiPadSecondaryColumn = showiPadSecondaryColumn
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var swipeActionsStatusTrailingRight: StatusAction {
|
||||||
|
didSet {
|
||||||
|
storage.swipeActionsStatusTrailingRight = swipeActionsStatusTrailingRight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var swipeActionsStatusTrailingLeft: StatusAction {
|
||||||
|
didSet {
|
||||||
|
storage.swipeActionsStatusTrailingLeft = swipeActionsStatusTrailingLeft
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var swipeActionsStatusLeadingLeft: StatusAction {
|
||||||
|
didSet {
|
||||||
|
storage.swipeActionsStatusLeadingLeft = swipeActionsStatusLeadingLeft
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var swipeActionsStatusLeadingRight: StatusAction {
|
||||||
|
didSet {
|
||||||
|
storage.swipeActionsStatusLeadingRight = swipeActionsStatusLeadingRight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var swipeActionsUseThemeColor: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.swipeActionsUseThemeColor = swipeActionsUseThemeColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var swipeActionsIconStyle: SwipeActionsIconStyle {
|
||||||
|
didSet {
|
||||||
|
storage.swipeActionsIconStyle = swipeActionsIconStyle
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var requestedReview: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.requestedReview = requestedReview
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var collapseLongPosts: Bool {
|
||||||
|
didSet {
|
||||||
|
storage.collapseLongPosts = collapseLongPosts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public var shareButtonBehavior: PreferredShareButtonBehavior {
|
||||||
|
didSet {
|
||||||
|
storage.shareButtonBehavior = shareButtonBehavior
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public enum SwipeActionsIconStyle: String, CaseIterable {
|
public enum SwipeActionsIconStyle: String, CaseIterable {
|
||||||
case iconWithText, iconOnly
|
case iconWithText, iconOnly
|
||||||
|
|
||||||
|
@ -133,7 +320,7 @@ public class UserPreferences: ObservableObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Published public var notificationsCount: [OauthToken: Int] = [:] {
|
public var notificationsCount: [OauthToken: Int] = [:] {
|
||||||
didSet {
|
didSet {
|
||||||
for (key, value) in notificationsCount {
|
for (key, value) in notificationsCount {
|
||||||
Self.sharedDefault?.set(value, forKey: "push_notifications_count_\(key.createdAt)")
|
Self.sharedDefault?.set(value, forKey: "push_notifications_count_\(key.createdAt)")
|
||||||
|
@ -152,9 +339,7 @@ public class UserPreferences: ObservableObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Published public var serverPreferences: ServerPreferences?
|
public var serverPreferences: ServerPreferences?
|
||||||
|
|
||||||
private init() {}
|
|
||||||
|
|
||||||
public func setClient(client: Client) {
|
public func setClient(client: Client) {
|
||||||
self.client = client
|
self.client = client
|
||||||
|
@ -189,4 +374,43 @@ public class UserPreferences: ObservableObject {
|
||||||
3
|
3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private init() {
|
||||||
|
remoteLocalTimelines = storage.remoteLocalTimelines
|
||||||
|
tagGroups = storage.tagGroups
|
||||||
|
preferredBrowser = storage.preferredBrowser
|
||||||
|
draftsPosts = storage.draftsPosts
|
||||||
|
showTranslateButton = storage.showTranslateButton
|
||||||
|
isOpenAIEnabled = storage.isOpenAIEnabled
|
||||||
|
recentlyUsedLanguages = storage.recentlyUsedLanguages
|
||||||
|
isSocialKeyboardEnabled = storage.isSocialKeyboardEnabled
|
||||||
|
useInstanceContentSettings = storage.useInstanceContentSettings
|
||||||
|
appAutoExpandSpoilers = storage.appAutoExpandSpoilers
|
||||||
|
appAutoExpandMedia = storage.appAutoExpandMedia
|
||||||
|
appDefaultPostVisibility = storage.appDefaultPostVisibility
|
||||||
|
appDefaultReplyVisibility = storage.appDefaultReplyVisibility
|
||||||
|
appDefaultPostsSensitive = storage.appDefaultPostsSensitive
|
||||||
|
autoPlayVideo = storage.autoPlayVideo
|
||||||
|
alwaysUseDeepl = storage.alwaysUseDeepl
|
||||||
|
userDeeplAPIFree = storage.userDeeplAPIFree
|
||||||
|
autoDetectPostLanguage = storage.autoDetectPostLanguage
|
||||||
|
suppressDupeReblogs = storage.suppressDupeReblogs
|
||||||
|
inAppBrowserReaderView = storage.inAppBrowserReaderView
|
||||||
|
hapticTabSelectionEnabled = storage.hapticTabSelectionEnabled
|
||||||
|
hapticTimelineEnabled = storage.hapticTimelineEnabled
|
||||||
|
hapticButtonPressEnabled = storage.hapticButtonPressEnabled
|
||||||
|
soundEffectEnabled = storage.soundEffectEnabled
|
||||||
|
showiPhoneTabLabel = storage.showiPhoneTabLabel
|
||||||
|
showAltTextForMedia = storage.showAltTextForMedia
|
||||||
|
showiPadSecondaryColumn = storage.showiPadSecondaryColumn
|
||||||
|
swipeActionsStatusTrailingRight = storage.swipeActionsStatusTrailingRight
|
||||||
|
swipeActionsStatusTrailingLeft = storage.swipeActionsStatusTrailingLeft
|
||||||
|
swipeActionsStatusLeadingLeft = storage.swipeActionsStatusLeadingLeft
|
||||||
|
swipeActionsStatusLeadingRight = storage.swipeActionsStatusLeadingRight
|
||||||
|
swipeActionsUseThemeColor = storage.swipeActionsUseThemeColor
|
||||||
|
swipeActionsIconStyle = storage.swipeActionsIconStyle
|
||||||
|
requestedReview = storage.requestedReview
|
||||||
|
collapseLongPosts = storage.collapseLongPosts
|
||||||
|
shareButtonBehavior = storage.shareButtonBehavior
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,9 @@ import NukeUI
|
||||||
import PhotosUI
|
import PhotosUI
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct StatusEditorAccessoryView: View {
|
struct StatusEditorAccessoryView: View {
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@Environment(CurrentInstance.self) private var currentInstance
|
@Environment(CurrentInstance.self) private var currentInstance
|
||||||
@Environment(\.colorScheme) private var colorScheme
|
@Environment(\.colorScheme) private var colorScheme
|
||||||
|
|
|
@ -14,7 +14,7 @@ import UIKit
|
||||||
@MainActor
|
@MainActor
|
||||||
public struct StatusEditorView: View {
|
public struct StatusEditorView: View {
|
||||||
@Environment(AppAccountsManager.self) private var appAccounts
|
@Environment(AppAccountsManager.self) private var appAccounts
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@Environment(Client.self) private var client
|
@Environment(Client.self) private var client
|
||||||
@Environment(CurrentAccount.self) private var currentAccount
|
@Environment(CurrentAccount.self) private var currentAccount
|
||||||
|
|
|
@ -51,7 +51,7 @@ import SwiftUI
|
||||||
struct VideoPlayerView: View {
|
struct VideoPlayerView: View {
|
||||||
@Environment(\.scenePhase) private var scenePhase
|
@Environment(\.scenePhase) private var scenePhase
|
||||||
@Environment(\.isCompact) private var isCompact
|
@Environment(\.isCompact) private var isCompact
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
|
|
||||||
@State var viewModel: VideoPlayerViewModel
|
@State var viewModel: VideoPlayerViewModel
|
||||||
|
|
|
@ -4,11 +4,12 @@ import Models
|
||||||
import Network
|
import Network
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct StatusRowActionsView: View {
|
struct StatusRowActionsView: View {
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@Environment(CurrentAccount.self) private var currentAccount
|
@Environment(CurrentAccount.self) private var currentAccount
|
||||||
@Environment(StatusDataController.self) private var statusDataController
|
@Environment(StatusDataController.self) private var statusDataController
|
||||||
@EnvironmentObject private var userPreferences: UserPreferences
|
@Environment(UserPreferences.self) private var userPreferences
|
||||||
|
|
||||||
@Environment(\.isStatusFocused) private var isFocused
|
@Environment(\.isStatusFocused) private var isFocused
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ struct StatusRowContextMenu: View {
|
||||||
|
|
||||||
@Environment(Client.self) private var client
|
@Environment(Client.self) private var client
|
||||||
@Environment(SceneDelegate.self) private var sceneDelegate
|
@Environment(SceneDelegate.self) private var sceneDelegate
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(CurrentAccount.self) private var account
|
@Environment(CurrentAccount.self) private var account
|
||||||
@Environment(CurrentInstance.self) private var currentInstance
|
@Environment(CurrentInstance.self) private var currentInstance
|
||||||
@Environment(StatusDataController.self) private var statusDataController
|
@Environment(StatusDataController.self) private var statusDataController
|
||||||
|
@ -87,7 +87,7 @@ struct StatusRowContextMenu: View {
|
||||||
}
|
}
|
||||||
.environment(\.isInCaptureMode, true)
|
.environment(\.isInCaptureMode, true)
|
||||||
.environment(Theme.shared)
|
.environment(Theme.shared)
|
||||||
.environmentObject(preferences)
|
.environment(preferences)
|
||||||
.environment(account)
|
.environment(account)
|
||||||
.environment(currentInstance)
|
.environment(currentInstance)
|
||||||
.environment(SceneDelegate())
|
.environment(SceneDelegate())
|
||||||
|
|
|
@ -5,6 +5,7 @@ import Nuke
|
||||||
import NukeUI
|
import NukeUI
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
public struct StatusRowMediaPreviewView: View {
|
public struct StatusRowMediaPreviewView: View {
|
||||||
@Environment(\.isSecondaryColumn) private var isSecondaryColumn: Bool
|
@Environment(\.isSecondaryColumn) private var isSecondaryColumn: Bool
|
||||||
@Environment(\.extraLeadingInset) private var extraLeadingInset: CGFloat
|
@Environment(\.extraLeadingInset) private var extraLeadingInset: CGFloat
|
||||||
|
@ -12,7 +13,7 @@ public struct StatusRowMediaPreviewView: View {
|
||||||
@Environment(\.isCompact) private var isCompact: Bool
|
@Environment(\.isCompact) private var isCompact: Bool
|
||||||
|
|
||||||
@Environment(SceneDelegate.self) private var sceneDelegate
|
@Environment(SceneDelegate.self) private var sceneDelegate
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(QuickLook.self) private var quickLook
|
@Environment(QuickLook.self) private var quickLook
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,10 @@ import Env
|
||||||
import Models
|
import Models
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct StatusRowSwipeView: View {
|
struct StatusRowSwipeView: View {
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(CurrentAccount.self) private var currentAccount
|
@Environment(CurrentAccount.self) private var currentAccount
|
||||||
@Environment(StatusDataController.self) private var statusDataController
|
@Environment(StatusDataController.self) private var statusDataController
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,12 @@ import Env
|
||||||
import Models
|
import Models
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@MainActor
|
||||||
struct StatusRowTranslateView: View {
|
struct StatusRowTranslateView: View {
|
||||||
@Environment(\.isInCaptureMode) private var isInCaptureMode: Bool
|
@Environment(\.isInCaptureMode) private var isInCaptureMode: Bool
|
||||||
@Environment(\.isCompact) private var isCompact: Bool
|
@Environment(\.isCompact) private var isCompact: Bool
|
||||||
|
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
|
|
||||||
var viewModel: StatusRowViewModel
|
var viewModel: StatusRowViewModel
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue