fix(IOS-INFO-041): load KB info on appear + fix initial loading state
- Set isLoadingSources = true initially to show spinner - Load KnowledgeBase detail in appear() for header - Prevents blank screen before data loads Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
5008e491a9
commit
f7d10f3f44
@ -144,13 +144,15 @@ struct LibraryDetailPage: View {
|
|||||||
@State private var detailTab = 1
|
@State private var detailTab = 1
|
||||||
|
|
||||||
private func appear() async {
|
private func appear() async {
|
||||||
|
// Load KB info and sources
|
||||||
|
viewModel.knowledgeBase = try? await KnowledgeBaseService.shared.detail(id: knowledgeBaseId)
|
||||||
await loadSources()
|
await loadSources()
|
||||||
}
|
}
|
||||||
@State private var sortOption = 0
|
@State private var sortOption = 0
|
||||||
@State private var showFolderManager = false
|
@State private var showFolderManager = false
|
||||||
@State private var sources: [KnowledgeSource] = []
|
@State private var sources: [KnowledgeSource] = []
|
||||||
@State private var sourceReadingStatus: [String: String] = [:]
|
@State private var sourceReadingStatus: [String: String] = [:]
|
||||||
@State private var isLoadingSources = false
|
@State private var isLoadingSources = true
|
||||||
|
|
||||||
private var allSelected: Bool {
|
private var allSelected: Bool {
|
||||||
!viewModel.items.isEmpty && selectedIds.count == viewModel.items.count
|
!viewModel.items.isEmpty && selectedIds.count == viewModel.items.count
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user