mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
1.3 Updates
This commit is contained in:
parent
afbf626dd1
commit
7b920aba1e
5 changed files with 45 additions and 5 deletions
|
|
@ -60,6 +60,7 @@
|
|||
DDC4D568275499A500A4208E /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC4D567275499A500A4208E /* Persistence.swift */; };
|
||||
DDD94A502845C8F5004A87A0 /* DateTimeText.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDD94A4F2845C8F5004A87A0 /* DateTimeText.swift */; };
|
||||
DDD9E4E4284B208E003777C5 /* UserEntityExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDD9E4E3284B208E003777C5 /* UserEntityExtension.swift */; };
|
||||
DDE393BA284E535700473991 /* ChannelHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDE393B9284E535700473991 /* ChannelHelper.swift */; };
|
||||
DDF924CA26FBB953009FE055 /* ConnectedDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF924C926FBB953009FE055 /* ConnectedDevice.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
|
|
@ -142,6 +143,7 @@
|
|||
DDCA31312826009C00207175 /* PassKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PassKit.framework; path = System/Library/Frameworks/PassKit.framework; sourceTree = SDKROOT; };
|
||||
DDD94A4F2845C8F5004A87A0 /* DateTimeText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateTimeText.swift; sourceTree = "<group>"; };
|
||||
DDD9E4E3284B208E003777C5 /* UserEntityExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserEntityExtension.swift; sourceTree = "<group>"; };
|
||||
DDE393B9284E535700473991 /* ChannelHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChannelHelper.swift; sourceTree = "<group>"; };
|
||||
DDF924C926FBB953009FE055 /* ConnectedDevice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectedDevice.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
|
|
@ -377,6 +379,7 @@
|
|||
DD913638270DFF4C00D7ACF3 /* LocalNotificationManager.swift */,
|
||||
DD8169F8271F1A6100F4AB02 /* MeshLogger.swift */,
|
||||
DDA6B2E828419CF2003E8C16 /* MeshPackets.swift */,
|
||||
DDE393B9284E535700473991 /* ChannelHelper.swift */,
|
||||
);
|
||||
path = Helpers;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -589,6 +592,7 @@
|
|||
DD2E65262767A01F00E45FC5 /* NodeDetail.swift in Sources */,
|
||||
DDA6B2E928419CF2003E8C16 /* MeshPackets.swift in Sources */,
|
||||
DDD94A502845C8F5004A87A0 /* DateTimeText.swift in Sources */,
|
||||
DDE393BA284E535700473991 /* ChannelHelper.swift in Sources */,
|
||||
C9A88B57278B559900BD810A /* apponly.pb.swift in Sources */,
|
||||
DD4C158E2824AA7E0032668E /* config.pb.swift in Sources */,
|
||||
DD47E3D926F3093800029299 /* MessageBubble.swift in Sources */,
|
||||
|
|
@ -761,7 +765,7 @@
|
|||
CODE_SIGN_ENTITLEMENTS = MeshtasticClient/MeshtasticClient.entitlements;
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 15;
|
||||
CURRENT_PROJECT_VERSION = 11;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"MeshtasticClient/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = GCH7VS5Y9R;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
|
|
@ -793,7 +797,7 @@
|
|||
CODE_SIGN_ENTITLEMENTS = MeshtasticClient/MeshtasticClient.entitlements;
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 15;
|
||||
CURRENT_PROJECT_VERSION = 11;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"MeshtasticClient/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = GCH7VS5Y9R;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
|
|
|
|||
|
|
@ -194,9 +194,9 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
}
|
||||
}
|
||||
|
||||
let today = Date()
|
||||
let visibleDuration = Calendar.current.date(byAdding: .second, value: -5, to: today)!
|
||||
peripherals.removeAll(where: { $0.lastUpdate <= visibleDuration})
|
||||
// let today = Date()
|
||||
// let visibleDuration = Calendar.current.date(byAdding: .second, value: -7, to: Date())!
|
||||
// peripherals.removeAll(where: { $0.lastUpdate <= visibleDuration})
|
||||
}
|
||||
|
||||
// Called when a peripheral is connected
|
||||
|
|
@ -296,6 +296,11 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) {
|
||||
|
||||
print(invalidatedServices)
|
||||
}
|
||||
|
||||
// MARK: Discover Characteristics Event
|
||||
func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) {
|
||||
|
|
|
|||
26
MeshtasticClient/Helpers/ChannelHelper.swift
Normal file
26
MeshtasticClient/Helpers/ChannelHelper.swift
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
//
|
||||
// ChannelHelper.swift
|
||||
// MeshtasticClient
|
||||
//
|
||||
// Created by Garth Vander Houwen on 6/6/22.
|
||||
//
|
||||
|
||||
//import Foundation
|
||||
//
|
||||
//
|
||||
//private fun urlToChannels(url: Uri): AppOnlyProtos.ChannelSet {
|
||||
// val urlStr = url.toString()
|
||||
//
|
||||
// val pathRegex = Regex("$prefix(.*)", RegexOption.IGNORE_CASE)
|
||||
// val (base64) = pathRegex.find(urlStr)?.destructured
|
||||
// ?: throw MalformedURLException("Not a meshtastic URL: ${urlStr.take(40)}")
|
||||
// val bytes = Base64.decode(base64, base64Flags)
|
||||
//
|
||||
// return AppOnlyProtos.ChannelSet.parseFrom(bytes)
|
||||
// }
|
||||
//
|
||||
//func urlToChannels(url: URL) {
|
||||
//
|
||||
// let urlString = url.absoluteString
|
||||
//
|
||||
//}
|
||||
|
|
@ -550,6 +550,8 @@ func textMessageAppPacket(packet: MeshPacket, connectedNode: Int64, meshLogging:
|
|||
|
||||
newMessage.fromUser = fetchedUsers.first(where: { $0.num == packet.from })
|
||||
newMessage.messagePayload = messageText
|
||||
newMessage.fromUser?.objectWillChange.send()
|
||||
newMessage.toUser?.objectWillChange.send()
|
||||
|
||||
do {
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ struct UserMessageList: View {
|
|||
@State private var sendPositionWithMessage: Bool = false
|
||||
|
||||
@State private var messageCount = 0
|
||||
@State private var refreshId = UUID()
|
||||
|
||||
var body: some View {
|
||||
|
||||
|
|
@ -335,6 +336,7 @@ struct UserMessageList: View {
|
|||
self.bleManager.userSettings = userSettings
|
||||
|
||||
messageCount = user.messageList.count
|
||||
refreshId = UUID()
|
||||
|
||||
})
|
||||
.onChange(of: messageCount, perform: { value in
|
||||
|
|
@ -343,6 +345,7 @@ struct UserMessageList: View {
|
|||
})
|
||||
.onChange(of: user.messageList, perform: { messages in
|
||||
|
||||
refreshId = UUID()
|
||||
messageCount = messages.count
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue