mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c2dda8591 | |||
| e7bf175dfc | |||
| d90dfc3d5a | |||
| 82d193de82 | |||
| 3aa1688cbd | |||
| 0debe17a08 |
@@ -13,6 +13,7 @@ struct ContentView: View {
|
|||||||
@EnvironmentObject var chatModel: ChatModel
|
@EnvironmentObject var chatModel: ChatModel
|
||||||
@ObservedObject var alertManager = AlertManager.shared
|
@ObservedObject var alertManager = AlertManager.shared
|
||||||
@ObservedObject var callController = CallController.shared
|
@ObservedObject var callController = CallController.shared
|
||||||
|
@ObservedObject var appSheetState = AppSheetState.shared
|
||||||
@Environment(\.colorScheme) var colorScheme
|
@Environment(\.colorScheme) var colorScheme
|
||||||
@EnvironmentObject var theme: AppTheme
|
@EnvironmentObject var theme: AppTheme
|
||||||
@EnvironmentObject var sceneDelegate: SceneDelegate
|
@EnvironmentObject var sceneDelegate: SceneDelegate
|
||||||
@@ -250,7 +251,8 @@ struct ContentView: View {
|
|||||||
|
|
||||||
private func mainView() -> some View {
|
private func mainView() -> some View {
|
||||||
ZStack(alignment: .top) {
|
ZStack(alignment: .top) {
|
||||||
ChatListView(activeUserPickerSheet: $chatListUserPickerSheet).privacySensitive(protectScreen)
|
ChatListView(activeUserPickerSheet: $chatListUserPickerSheet)
|
||||||
|
.redacted(reason: appSheetState.redactionReasons(protectScreen))
|
||||||
.onAppear {
|
.onAppear {
|
||||||
requestNtfAuthorization()
|
requestNtfAuthorization()
|
||||||
// Local Authentication notice is to be shown on next start after onboarding is complete
|
// Local Authentication notice is to be shown on next start after onboarding is complete
|
||||||
|
|||||||
@@ -121,9 +121,11 @@ struct ChatListView: View {
|
|||||||
UserPicker(userPickerShown: $userPickerShown, activeSheet: $activeUserPickerSheet)
|
UserPicker(userPickerShown: $userPickerShown, activeSheet: $activeUserPickerSheet)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.sheet(item: $activeUserPickerSheet) {
|
.appSheet(
|
||||||
UserPickerSheetView(sheet: $0)
|
item: $activeUserPickerSheet,
|
||||||
}
|
onDismiss: { chatModel.laRequest = nil },
|
||||||
|
content: { UserPickerSheetView(sheet: $0) }
|
||||||
|
)
|
||||||
.onChange(of: activeUserPickerSheet) {
|
.onChange(of: activeUserPickerSheet) {
|
||||||
if $0 != nil {
|
if $0 != nil {
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
||||||
|
|||||||
@@ -11,6 +11,12 @@ import SwiftUI
|
|||||||
class AppSheetState: ObservableObject {
|
class AppSheetState: ObservableObject {
|
||||||
static let shared = AppSheetState()
|
static let shared = AppSheetState()
|
||||||
@Published var scenePhaseActive: Bool = false
|
@Published var scenePhaseActive: Bool = false
|
||||||
|
|
||||||
|
func redactionReasons(_ protectScreen: Bool) -> RedactionReasons {
|
||||||
|
!protectScreen || scenePhaseActive
|
||||||
|
? RedactionReasons()
|
||||||
|
: RedactionReasons.placeholder
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct PrivacySensitive: ViewModifier {
|
private struct PrivacySensitive: ViewModifier {
|
||||||
@@ -19,11 +25,7 @@ private struct PrivacySensitive: ViewModifier {
|
|||||||
@ObservedObject var appSheetState: AppSheetState = AppSheetState.shared
|
@ObservedObject var appSheetState: AppSheetState = AppSheetState.shared
|
||||||
|
|
||||||
func body(content: Content) -> some View {
|
func body(content: Content) -> some View {
|
||||||
if !protectScreen {
|
content.redacted(reason: appSheetState.redactionReasons(protectScreen))
|
||||||
content
|
|
||||||
} else {
|
|
||||||
content.privacySensitive(!appSheetState.scenePhaseActive).redacted(reason: .privacy)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,11 @@ struct TerminalView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationViewStyle(.stack)
|
.navigationViewStyle(.stack)
|
||||||
.navigationTitle("Chat console")
|
.toolbar {
|
||||||
|
ToolbarItem(placement: .principal) {
|
||||||
|
Text("Chat console").font(.headline)
|
||||||
|
}
|
||||||
|
}
|
||||||
.modifier(ThemedBackground())
|
.modifier(ThemedBackground())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -331,7 +331,11 @@ struct SettingsView: View {
|
|||||||
chatDatabaseRow()
|
chatDatabaseRow()
|
||||||
NavigationLink {
|
NavigationLink {
|
||||||
MigrateFromDevice(showProgressOnSettings: $showProgress)
|
MigrateFromDevice(showProgressOnSettings: $showProgress)
|
||||||
.navigationTitle("Migrate device")
|
.toolbar {
|
||||||
|
ToolbarItem(placement: .principal) {
|
||||||
|
Text("Migrate device").font(.headline)
|
||||||
|
}
|
||||||
|
}
|
||||||
.modifier(ThemedBackground(grouped: true))
|
.modifier(ThemedBackground(grouped: true))
|
||||||
.navigationBarTitleDisplayMode(.large)
|
.navigationBarTitleDisplayMode(.large)
|
||||||
} label: {
|
} label: {
|
||||||
|
|||||||
Reference in New Issue
Block a user