delete error
This commit is contained in:
		
							parent
							
								
									1bc4dda14c
								
							
						
					
					
						commit
						edbf4faf00
					
				@ -1,6 +1,11 @@
 | 
				
			|||||||
import Foundation
 | 
					import Foundation
 | 
				
			||||||
import Combine
 | 
					import Combine
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					struct ChatNavigationTarget: Identifiable {
 | 
				
			||||||
 | 
					    let id = UUID()
 | 
				
			||||||
 | 
					    let chat: PrivateChatListItem
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
final class IncomingMessageCenter: ObservableObject {
 | 
					final class IncomingMessageCenter: ObservableObject {
 | 
				
			||||||
    @Published private(set) var banner: IncomingMessageBanner?
 | 
					    @Published private(set) var banner: IncomingMessageBanner?
 | 
				
			||||||
    @Published var presentedChat: PrivateChatListItem?
 | 
					    @Published var presentedChat: PrivateChatListItem?
 | 
				
			||||||
@ -122,9 +127,4 @@ final class IncomingMessageCenter: ObservableObject {
 | 
				
			|||||||
        dismissWorkItem = workItem
 | 
					        dismissWorkItem = workItem
 | 
				
			||||||
        DispatchQueue.main.asyncAfter(deadline: .now() + delay, execute: workItem)
 | 
					        DispatchQueue.main.asyncAfter(deadline: .now() + delay, execute: workItem)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    struct ChatNavigationTarget: Identifiable {
 | 
					 | 
				
			||||||
        let id = UUID()
 | 
					 | 
				
			||||||
        let chat: PrivateChatListItem
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -12,7 +12,7 @@ import UIKit
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
struct ChatsTab: View {
 | 
					struct ChatsTab: View {
 | 
				
			||||||
    @ObservedObject private var loginViewModel: LoginViewModel
 | 
					    @ObservedObject private var loginViewModel: LoginViewModel
 | 
				
			||||||
    @Binding private var pendingNavigation: IncomingMessageCenter.ChatNavigationTarget?
 | 
					    @Binding private var pendingNavigation: ChatNavigationTarget?
 | 
				
			||||||
    @Binding var searchRevealProgress: CGFloat
 | 
					    @Binding var searchRevealProgress: CGFloat
 | 
				
			||||||
    @Binding var searchText: String
 | 
					    @Binding var searchText: String
 | 
				
			||||||
    private let searchService = SearchService()
 | 
					    private let searchService = SearchService()
 | 
				
			||||||
@ -41,7 +41,7 @@ struct ChatsTab: View {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    init(
 | 
					    init(
 | 
				
			||||||
        loginViewModel: LoginViewModel,
 | 
					        loginViewModel: LoginViewModel,
 | 
				
			||||||
        pendingNavigation: Binding<IncomingMessageCenter.ChatNavigationTarget?>,
 | 
					        pendingNavigation: Binding<ChatNavigationTarget?>,
 | 
				
			||||||
        searchRevealProgress: Binding<CGFloat>,
 | 
					        searchRevealProgress: Binding<CGFloat>,
 | 
				
			||||||
        searchText: Binding<String>
 | 
					        searchText: Binding<String>
 | 
				
			||||||
    ) {
 | 
					    ) {
 | 
				
			||||||
@ -1195,7 +1195,7 @@ struct ChatsTab_Previews: PreviewProvider {
 | 
				
			|||||||
        @State private var progress: CGFloat = 1
 | 
					        @State private var progress: CGFloat = 1
 | 
				
			||||||
        @State private var searchText: String = ""
 | 
					        @State private var searchText: String = ""
 | 
				
			||||||
        @StateObject private var loginViewModel = LoginViewModel()
 | 
					        @StateObject private var loginViewModel = LoginViewModel()
 | 
				
			||||||
        @State private var pendingNavigation: IncomingMessageCenter.ChatNavigationTarget?
 | 
					        @State private var pendingNavigation: ChatNavigationTarget?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var body: some View {
 | 
					        var body: some View {
 | 
				
			||||||
            ChatsTab(
 | 
					            ChatsTab(
 | 
				
			||||||
 | 
				
			|||||||
@ -34,7 +34,7 @@ struct MainView: View {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    var body: some View {
 | 
					    var body: some View {
 | 
				
			||||||
        NavigationView {
 | 
					        NavigationView {
 | 
				
			||||||
            let pendingNavigationBinding: Binding<IncomingMessageCenter.ChatNavigationTarget?> = AppConfig.PRESENT_CHAT_AS_SHEET
 | 
					            let pendingNavigationBinding: Binding<ChatNavigationTarget?> = AppConfig.PRESENT_CHAT_AS_SHEET
 | 
				
			||||||
                ? .constant(nil)
 | 
					                ? .constant(nil)
 | 
				
			||||||
                : Binding(
 | 
					                : Binding(
 | 
				
			||||||
                    get: { messageCenter.pendingNavigation },
 | 
					                    get: { messageCenter.pendingNavigation },
 | 
				
			||||||
 | 
				
			|||||||
@ -14,7 +14,7 @@ struct AppConfig {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    static let DISABLE_DB = false
 | 
					    static let DISABLE_DB = false
 | 
				
			||||||
    /// Controls whether incoming chat opens as a modal sheet (`true`) or navigates to Chats tab (`false`).
 | 
					    /// Controls whether incoming chat opens as a modal sheet (`true`) or navigates to Chats tab (`false`).
 | 
				
			||||||
    static let PRESENT_CHAT_AS_SHEET = true
 | 
					    static let PRESENT_CHAT_AS_SHEET = false
 | 
				
			||||||
    /// Fallback SQLCipher key used until the user sets an application password.
 | 
					    /// Fallback SQLCipher key used until the user sets an application password.
 | 
				
			||||||
    static let DEFAULT_DATABASE_ENCRYPTION_KEY = "yobble_dev_change_me"
 | 
					    static let DEFAULT_DATABASE_ENCRYPTION_KEY = "yobble_dev_change_me"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user