Skip to content

Commit

Permalink
Merge pull request #775 from meshtastic/2.3.16
Browse files Browse the repository at this point in the history
2.3.16 Specific Updates
  • Loading branch information
garthvh authored Jul 10, 2024
2 parents cd1b25e + 5c57d38 commit 9db0dc8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
29 changes: 24 additions & 5 deletions Meshtastic/MeshtasticApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")")
Expand Down
3 changes: 2 additions & 1 deletion Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
2 changes: 1 addition & 1 deletion Meshtastic/Views/Settings/ShareChannels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
}

0 comments on commit 9db0dc8

Please sign in to comment.