From c779461c5d1ed9799a8c2194ab9b05247e5555fe Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Sat, 13 Jul 2024 08:06:10 -0700 Subject: [PATCH] Set right default for weather kit setting --- Meshtastic/Extensions/UserDefaults.swift | 3 ++- Meshtastic/Views/Messages/ChannelList.swift | 2 +- Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift | 2 +- Meshtastic/Views/Nodes/NodeList.swift | 6 ++---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Meshtastic/Extensions/UserDefaults.swift b/Meshtastic/Extensions/UserDefaults.swift index db25b22d..11049bfb 100644 --- a/Meshtastic/Extensions/UserDefaults.swift +++ b/Meshtastic/Extensions/UserDefaults.swift @@ -162,7 +162,8 @@ extension UserDefaults { @UserDefault(.firmwareVersion, defaultValue: "0.0.0") static var firmwareVersion: String - @UserDefault(.environmentEnableWeatherKit, defaultValue: false) + + @UserDefault(.environmentEnableWeatherKit, defaultValue: true) static var environmentEnableWeatherKit: Bool @UserDefault(.testIntEnum, defaultValue: .one) diff --git a/Meshtastic/Views/Messages/ChannelList.swift b/Meshtastic/Views/Messages/ChannelList.swift index c4957bbc..30738fa3 100644 --- a/Meshtastic/Views/Messages/ChannelList.swift +++ b/Meshtastic/Views/Messages/ChannelList.swift @@ -102,7 +102,7 @@ struct ChannelList: View { VStack { // Display Contacts for the rest of the non admin channels if let node, let myInfo = node.myInfo, let channels = myInfo.channels?.array as? [ChannelEntity] { - List(channels, id: \.self) { (channel: ChannelEntity) in + List(channels, id: \.self, selection: $channelSelection) { (channel: ChannelEntity) in if !restrictedChannels.contains(channel.name?.lowercased() ?? "") { makeNavigationLink(myInfo: myInfo, channel: channel) .frame(height: 62) diff --git a/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift b/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift index 784e2b7b..41ccf866 100644 --- a/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift +++ b/Meshtastic/Views/Nodes/Helpers/NodeInfoItem.swift @@ -62,7 +62,7 @@ struct NodeInfoItem: View { .foregroundColor(getRssiColor(rssi: node.rssi)) .font(.caption2) } - .frame(minWidth: 90, maxWidth: 180) + .frame(minWidth: 100, maxWidth: 140) } if node.telemetries?.count ?? 0 > 0 { diff --git a/Meshtastic/Views/Nodes/NodeList.swift b/Meshtastic/Views/Nodes/NodeList.swift index e06bbcc0..b641db2d 100644 --- a/Meshtastic/Views/Nodes/NodeList.swift +++ b/Meshtastic/Views/Nodes/NodeList.swift @@ -24,7 +24,7 @@ struct NodeList: View { @State private var hopsAway: Double = -1.0 @State private var roleFilter = false @State private var deviceRoles: Set = [] - + var boolFilters: [Bool] {[ isOnline, isFavorite, @@ -46,7 +46,7 @@ struct NodeList: View { NSSortDescriptor(key: "lastHeard", ascending: false), NSSortDescriptor(key: "user.longName", ascending: true), ], - animation: .default + animation: .spring ) var nodes: FetchedResults @@ -299,7 +299,6 @@ struct NodeList: View { let hopsAwayPredicate = NSPredicate(format: "hopsAway > 0 AND hopsAway <= %i", Int32(hopsAway)) predicates.append(hopsAwayPredicate) } - /// Online if isOnline { let isOnlinePredicate = NSPredicate(format: "lastHeard >= %@", Calendar.current.date(byAdding: .minute, value: -15, to: Date())! as NSDate) @@ -333,7 +332,6 @@ struct NodeList: View { predicates.append(distancePredicate) } } - if predicates.count > 0 || !searchText.isEmpty { if !searchText.isEmpty { let filterPredicates = NSCompoundPredicate(type: .and, subpredicates: predicates)