diff options
Diffstat (limited to 'Hutch/Views/Inbox/InboxView.swift')
| -rw-r--r-- | Hutch/Views/Inbox/InboxView.swift | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Hutch/Views/Inbox/InboxView.swift b/Hutch/Views/Inbox/InboxView.swift index 74f78d5..5724964 100644 --- a/Hutch/Views/Inbox/InboxView.swift +++ b/Hutch/Views/Inbox/InboxView.swift @@ -30,7 +30,7 @@ struct InboxView: View { @Bindable var vm = viewModel List { - ForEach(viewModel.threads) { thread in + ForEach(viewModel.filteredThreads) { thread in Button { selectThread(thread) } label: { @@ -45,6 +45,11 @@ struct InboxView: View { } } } + .searchable( + text: $vm.searchText, + placement: .navigationBarDrawer(displayMode: .always), + prompt: "Search inbox" + ) .listStyle(.plain) .overlay { if viewModel.isLoading, viewModel.threads.isEmpty { @@ -55,6 +60,8 @@ struct InboxView: View { message: error, retryAction: { await viewModel.loadThreads() } ) + } else if !viewModel.threads.isEmpty, viewModel.filteredThreads.isEmpty { + ContentUnavailableView.search(text: viewModel.searchText) } else if viewModel.threads.isEmpty, viewModel.error == nil { ContentUnavailableView( "Inbox Zero", |
