fix(reader): tie viewer avatars to the Viewer Insights toggle

Turning off Viewer Insights didn't hide the avatar stack until the
view was torn down and rebuilt - that data belongs to the insights
feature, so gate it on isInsightsEnabled directly instead of only on
whether any viewers loaded.
This commit is contained in:
2026-08-14 16:14:33 +01:00
parent 02023cf382
commit 278e93ddeb
@@ -227,7 +227,10 @@ struct DocumentReaderView: View {
@ViewBuilder
private var viewerAvatars: some View {
if !viewModel.viewers.isEmpty {
// Tied to the Viewer Insights toggle that's the feature this data
// belongs to, so turning it off should hide the avatars immediately
// rather than leaving them showing until the view reloads.
if viewModel.isInsightsEnabled == true, !viewModel.viewers.isEmpty {
HStack(spacing: -6) {
ForEach(viewModel.viewers.prefix(5)) { viewer in
AvatarBadge(