From e855a2e40b8ee4957cfe2e9f4bd771dfa2fbc882 Mon Sep 17 00:00:00 2001 From: jack Date: Sat, 13 Sep 2025 22:46:43 +0200 Subject: [PATCH] =?UTF-8?q?Notes=20icon:=20use=20sheet=20count=20until=20c?= =?UTF-8?q?ounter=20finishes=20initial=20load;=20don=E2=80=99t=20zero=20on?= =?UTF-8?q?=20sheet=20close\n\n-=20Compute=20hasNotes=20using=20max(count,?= =?UTF-8?q?=20sheetCount)=20while=20initialLoadComplete=20is=20false.\n-?= =?UTF-8?q?=20Remove=20sheetNotesCount=20reset=20on=20sheet=20disappear=20?= =?UTF-8?q?to=20avoid=20transient=20grey.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bitchat/Views/ContentView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitchat/Views/ContentView.swift b/bitchat/Views/ContentView.swift index 42f0f0bc..b146f69e 100644 --- a/bitchat/Views/ContentView.swift +++ b/bitchat/Views/ContentView.swift @@ -1190,7 +1190,8 @@ struct ContentView: View { showLocationNotes = true }) { HStack(alignment: .center, spacing: 4) { - let hasNotes = ((notesCounter.count ?? 0) > 0) || (sheetNotesCount > 0) + let currentCount = (notesCounter.count ?? 0) + let hasNotes = (!notesCounter.initialLoadComplete ? max(currentCount, sheetNotesCount) : currentCount) > 0 Image(systemName: "long.text.page.and.pencil") .font(.system(size: 12)) .foregroundColor(hasNotes ? textColor : Color.gray) @@ -1283,7 +1284,6 @@ struct ContentView: View { } .onDisappear { LocationChannelManager.shared.endLiveRefresh() - sheetNotesCount = 0 } .onChange(of: locationManager.availableChannels) { channels in if let current = channels.first(where: { $0.level == .building })?.geohash,