diff --git a/Meshtastic/MeshtasticApp.swift b/Meshtastic/MeshtasticApp.swift index b00fab92e..578f16d41 100644 --- a/Meshtastic/MeshtasticApp.swift +++ b/Meshtastic/MeshtasticApp.swift @@ -40,11 +40,18 @@ struct MeshtasticAppleApp: App { if (self.incomingUrl?.absoluteString.lowercased().contains("meshtastic.org/e/#")) != nil { if let components = self.incomingUrl?.absoluteString.components(separatedBy: "#") { - guard let cs = components.last!.components(separatedBy: "?").first else { - return - } - self.channelSettings = cs self.addChannels = Bool(self.incomingUrl?["add"] ?? "false") ?? false + if ((self.incomingUrl?.absoluteString.lowercased().contains("?")) != nil) { + guard let cs = components.last!.components(separatedBy: "?").first else { + return + } + self.channelSettings = cs + } else { + guard let cs = components.first else { + return + } + self.channelSettings = cs + } Logger.services.debug("Add Channel \(self.addChannels)") } self.saveChannels = true @@ -60,7 +67,19 @@ struct MeshtasticAppleApp: App { self.incomingUrl = url if url.absoluteString.lowercased().contains("meshtastic.org/e/#") { if let components = self.incomingUrl?.absoluteString.components(separatedBy: "#") { - self.channelSettings = components.last! + self.addChannels = Bool(self.incomingUrl?["add"] ?? "false") ?? false + if ((self.incomingUrl?.absoluteString.lowercased().contains("?")) != nil) { + guard let cs = components.last!.components(separatedBy: "?").first else { + return + } + self.channelSettings = cs + } else { + guard let cs = components.first else { + return + } + self.channelSettings = cs + } + Logger.services.debug("Add Channel \(self.addChannels)") } self.saveChannels = true Logger.mesh.debug("User wants to open a Channel Settings URL: \(self.incomingUrl?.absoluteString ?? "No QR Code Link")") diff --git a/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift b/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift index e94baf3af..0ca9d012c 100644 --- a/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift +++ b/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift @@ -61,13 +61,14 @@ struct NodeInfoItem: View { .foregroundColor(getRssiColor(rssi: node.rssi)) .font(.caption2) } + .frame(minWidth: 90, maxWidth: 180) } if node.telemetries?.count ?? 0 > 0 { BatteryGauge(node: node) .padding() } - Spacer() } + .padding(.leading) } } diff --git a/Meshtastic/Views/Settings/ShareChannels.swift b/Meshtastic/Views/Settings/ShareChannels.swift index 51d066eb9..3859693e4 100644 --- a/Meshtastic/Views/Settings/ShareChannels.swift +++ b/Meshtastic/Views/Settings/ShareChannels.swift @@ -319,7 +319,7 @@ struct ShareChannels: View { guard let settingsString = try? channelSet.serializedData().base64EncodedString() else { return } - channelsUrl = ("https://meshtastic.org/e/#" + settingsString.base64ToBase64url() + (replaceChannels ? "" : "?add=true")) + channelsUrl = ("https://meshtastic.org/e/\(replaceChannels ? "" : "?add=true")#" + settingsString.base64ToBase64url()) } } }