mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 05:05:19 +00:00
Notes header: bold count text; ensure sheet updates when building geohash changes by calling manager.setGeohash on geohash change
This commit is contained in:
@@ -1282,10 +1282,31 @@ struct ContentView: View {
|
||||
LocationChannelManager.shared.endLiveRefresh()
|
||||
}
|
||||
}
|
||||
.onAppear { updateNotesCounterSubscription() }
|
||||
.onChange(of: locationManager.selectedChannel) { _ in updateNotesCounterSubscription() }
|
||||
.onAppear {
|
||||
updateNotesCounterSubscription()
|
||||
if case .mesh = locationManager.selectedChannel,
|
||||
locationManager.permissionState == .authorized,
|
||||
LocationChannelManager.shared.availableChannels.isEmpty {
|
||||
LocationChannelManager.shared.refreshChannels()
|
||||
}
|
||||
}
|
||||
.onChange(of: locationManager.selectedChannel) { _ in
|
||||
updateNotesCounterSubscription()
|
||||
if case .mesh = locationManager.selectedChannel,
|
||||
locationManager.permissionState == .authorized,
|
||||
LocationChannelManager.shared.availableChannels.isEmpty {
|
||||
LocationChannelManager.shared.refreshChannels()
|
||||
}
|
||||
}
|
||||
.onChange(of: locationManager.availableChannels) { _ in updateNotesCounterSubscription() }
|
||||
.onChange(of: locationManager.permissionState) { _ in updateNotesCounterSubscription() }
|
||||
.onChange(of: locationManager.permissionState) { _ in
|
||||
updateNotesCounterSubscription()
|
||||
if case .mesh = locationManager.selectedChannel,
|
||||
locationManager.permissionState == .authorized,
|
||||
LocationChannelManager.shared.availableChannels.isEmpty {
|
||||
LocationChannelManager.shared.refreshChannels()
|
||||
}
|
||||
}
|
||||
.alert("heads up", isPresented: $viewModel.showScreenshotPrivacyWarning) {
|
||||
Button("ok", role: .cancel) {}
|
||||
} message: {
|
||||
|
||||
@@ -37,6 +37,9 @@ struct LocationNotesView: View {
|
||||
.background(backgroundColor)
|
||||
.foregroundColor(textColor)
|
||||
.onDisappear { manager.cancel() }
|
||||
.onChange(of: geohash) { newValue in
|
||||
manager.setGeohash(newValue)
|
||||
}
|
||||
}
|
||||
|
||||
private var header: some View {
|
||||
@@ -45,7 +48,7 @@ struct LocationNotesView: View {
|
||||
HStack(spacing: 4) {
|
||||
let c = manager.notes.count
|
||||
Text("\(c) \(c == 1 ? "note" : "notes") ")
|
||||
.font(.system(size: 16, weight: .regular, design: .monospaced))
|
||||
.font(.system(size: 16, weight: .bold, design: .monospaced))
|
||||
Text("@ #\(geohash)")
|
||||
.font(.system(size: 16, weight: .bold, design: .monospaced))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user