Refresh sidebar folders when the advanced conversation list closes
Creating/renaming/deleting a folder in ConversationListView only ever updated its own local @State — the sidebar has a separate folders array that was only refreshed by onAppear or conversation-change triggers, so a folder created in the modal didn't show up in the sidebar until the next app launch. Sidebar now reloads when showConversations transitions to false (the modal closing).
This commit is contained in:
@@ -167,6 +167,11 @@ struct SidebarView: View {
|
||||
}
|
||||
.onChange(of: chatViewModel.currentConversationName) { loadData() }
|
||||
.onChange(of: chatViewModel.messages.count) { loadData() }
|
||||
.onChange(of: chatViewModel.showConversations) { _, isShowing in
|
||||
// Folders/conversations created, renamed, or deleted in the advanced
|
||||
// conversation list modal live in its own @State — refresh ours once it closes.
|
||||
if !isShowing { loadData() }
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
|
||||
Reference in New Issue
Block a user