mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 14:05:18 +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()
|
LocationChannelManager.shared.endLiveRefresh()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.onAppear { updateNotesCounterSubscription() }
|
.onAppear {
|
||||||
.onChange(of: locationManager.selectedChannel) { _ in updateNotesCounterSubscription() }
|
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.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) {
|
.alert("heads up", isPresented: $viewModel.showScreenshotPrivacyWarning) {
|
||||||
Button("ok", role: .cancel) {}
|
Button("ok", role: .cancel) {}
|
||||||
} message: {
|
} message: {
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ struct LocationNotesView: View {
|
|||||||
.background(backgroundColor)
|
.background(backgroundColor)
|
||||||
.foregroundColor(textColor)
|
.foregroundColor(textColor)
|
||||||
.onDisappear { manager.cancel() }
|
.onDisappear { manager.cancel() }
|
||||||
|
.onChange(of: geohash) { newValue in
|
||||||
|
manager.setGeohash(newValue)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var header: some View {
|
private var header: some View {
|
||||||
@@ -45,7 +48,7 @@ struct LocationNotesView: View {
|
|||||||
HStack(spacing: 4) {
|
HStack(spacing: 4) {
|
||||||
let c = manager.notes.count
|
let c = manager.notes.count
|
||||||
Text("\(c) \(c == 1 ? "note" : "notes") ")
|
Text("\(c) \(c == 1 ? "note" : "notes") ")
|
||||||
.font(.system(size: 16, weight: .regular, design: .monospaced))
|
.font(.system(size: 16, weight: .bold, design: .monospaced))
|
||||||
Text("@ #\(geohash)")
|
Text("@ #\(geohash)")
|
||||||
.font(.system(size: 16, weight: .bold, design: .monospaced))
|
.font(.system(size: 16, weight: .bold, design: .monospaced))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user