mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-22 23:26:37 +00:00
Support server side default post visibility
This commit is contained in:
parent
dc223171b3
commit
2961793e87
4 changed files with 10 additions and 4 deletions
|
@ -7,6 +7,7 @@ import Env
|
||||||
import Network
|
import Network
|
||||||
|
|
||||||
struct ExploreTab: View {
|
struct ExploreTab: View {
|
||||||
|
@EnvironmentObject private var preferences: UserPreferences
|
||||||
@EnvironmentObject private var currentAccount: CurrentAccount
|
@EnvironmentObject private var currentAccount: CurrentAccount
|
||||||
@EnvironmentObject private var client: Client
|
@EnvironmentObject private var client: Client
|
||||||
@StateObject private var routeurPath = RouterPath()
|
@StateObject private var routeurPath = RouterPath()
|
||||||
|
@ -18,7 +19,8 @@ struct ExploreTab: View {
|
||||||
.withAppRouteur()
|
.withAppRouteur()
|
||||||
.withSheetDestinations(sheetDestinations: $routeurPath.presentedSheet)
|
.withSheetDestinations(sheetDestinations: $routeurPath.presentedSheet)
|
||||||
.toolbar {
|
.toolbar {
|
||||||
statusEditorToolbarItem(routeurPath: routeurPath, visibility: .pub)
|
statusEditorToolbarItem(routeurPath: routeurPath,
|
||||||
|
visibility: preferences.serverPreferences?.postVisibility ?? .pub)
|
||||||
ToolbarItem(placement: .navigationBarLeading) {
|
ToolbarItem(placement: .navigationBarLeading) {
|
||||||
AppAccountsSelectorView(routeurPath: routeurPath)
|
AppAccountsSelectorView(routeurPath: routeurPath)
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,8 @@ struct NotificationsTab: View {
|
||||||
.withAppRouteur()
|
.withAppRouteur()
|
||||||
.withSheetDestinations(sheetDestinations: $routeurPath.presentedSheet)
|
.withSheetDestinations(sheetDestinations: $routeurPath.presentedSheet)
|
||||||
.toolbar {
|
.toolbar {
|
||||||
statusEditorToolbarItem(routeurPath: routeurPath, visibility: .pub)
|
statusEditorToolbarItem(routeurPath: routeurPath,
|
||||||
|
visibility: userPreferences.serverPreferences?.postVisibility ?? .pub)
|
||||||
ToolbarItem(placement: .navigationBarLeading) {
|
ToolbarItem(placement: .navigationBarLeading) {
|
||||||
AppAccountsSelectorView(routeurPath: routeurPath)
|
AppAccountsSelectorView(routeurPath: routeurPath)
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,8 @@ struct TimelineTab: View {
|
||||||
ToolbarItem(placement: .navigationBarLeading) {
|
ToolbarItem(placement: .navigationBarLeading) {
|
||||||
AppAccountsSelectorView(routeurPath: routeurPath)
|
AppAccountsSelectorView(routeurPath: routeurPath)
|
||||||
}
|
}
|
||||||
statusEditorToolbarItem(routeurPath: routeurPath, visibility: .pub)
|
statusEditorToolbarItem(routeurPath: routeurPath,
|
||||||
|
visibility: preferences.serverPreferences?.postVisibility ?? .pub)
|
||||||
} else {
|
} else {
|
||||||
ToolbarItem(placement: .navigationBarTrailing) {
|
ToolbarItem(placement: .navigationBarTrailing) {
|
||||||
addAccountButton
|
addAccountButton
|
||||||
|
|
|
@ -10,6 +10,7 @@ public struct AccountDetailView: View {
|
||||||
@Environment(\.redactionReasons) private var reasons
|
@Environment(\.redactionReasons) private var reasons
|
||||||
@EnvironmentObject private var watcher: StreamWatcher
|
@EnvironmentObject private var watcher: StreamWatcher
|
||||||
@EnvironmentObject private var currentAccount: CurrentAccount
|
@EnvironmentObject private var currentAccount: CurrentAccount
|
||||||
|
@EnvironmentObject private var preferences: UserPreferences
|
||||||
@EnvironmentObject private var theme: Theme
|
@EnvironmentObject private var theme: Theme
|
||||||
@EnvironmentObject private var client: Client
|
@EnvironmentObject private var client: Client
|
||||||
@EnvironmentObject private var routeurPath: RouterPath
|
@EnvironmentObject private var routeurPath: RouterPath
|
||||||
|
@ -334,7 +335,8 @@ public struct AccountDetailView: View {
|
||||||
Section(account.acct) {
|
Section(account.acct) {
|
||||||
if !viewModel.isCurrentUser {
|
if !viewModel.isCurrentUser {
|
||||||
Button {
|
Button {
|
||||||
routeurPath.presentedSheet = .mentionStatusEditor(account: account, visibility: .pub)
|
routeurPath.presentedSheet = .mentionStatusEditor(account: account,
|
||||||
|
visibility: preferences.serverPreferences?.postVisibility ?? .pub)
|
||||||
} label: {
|
} label: {
|
||||||
Label("Mention", systemImage: "at")
|
Label("Mention", systemImage: "at")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue