fix: only show bridged mesh warning when nearby-only is off

Bridge-on plus nearby-only still keeps #mesh radio-local, so the
Nostr-relay wording must not fire in that case.
This commit is contained in:
Taksh 2026-09-25 21:31:25 +05:30
parent b469de7447
commit ec8ca6e455
2 changed files with 10 additions and 2 deletions

View File

@ -10,7 +10,10 @@ import SwiftUI
/// Dismissible banner reminding people that #mesh is a plaintext broadcast (#1064).
struct MeshPlaintextNoticeView: View {
/// Bridge feature is on in settings.
var bridgeEnabled: Bool
/// Outgoing mesh stays radio-local even when the bridge feature is on.
var nearbyOnly: Bool
var onDismiss: () -> Void
@ThemedPalette private var palette
@ -37,8 +40,10 @@ struct MeshPlaintextNoticeView: View {
)
}
/// Bridged exposure only applies when the bridge is on *and* nearby-only
/// is off — otherwise outgoing #mesh stays radio-local.
private var bodyText: String {
bridgeEnabled ? Strings.bodyBridged : Strings.bodyNearbyOnly
(bridgeEnabled && !nearbyOnly) ? Strings.bodyBridged : Strings.bodyNearbyOnly
}
var body: some View {

View File

@ -34,7 +34,10 @@ struct ContentComposerView: View {
var body: some View {
VStack(alignment: .leading, spacing: 6) {
if showsMeshPlaintextNotice {
MeshPlaintextNoticeView(bridgeEnabled: bridgeService.isEnabled) {
MeshPlaintextNoticeView(
bridgeEnabled: bridgeService.isEnabled,
nearbyOnly: bridgeService.nearbyOnly
) {
meshPlaintextNoticeDismissed = true
MeshPlaintextNoticeSettings.isDismissed = true
}