mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Receive messages code
This commit is contained in:
parent
50c3b17768
commit
28bdd7a39a
6 changed files with 56 additions and 7 deletions
|
|
@ -22,11 +22,11 @@ class MessageData: ObservableObject {
|
|||
func load() {
|
||||
DispatchQueue.global(qos: .background).async { [weak self] in
|
||||
guard let data = try? Data(contentsOf: Self.fileURL) else {
|
||||
//#if DEBUG
|
||||
#if DEBUG
|
||||
DispatchQueue.main.async {
|
||||
self?.messages = MessageModel.data
|
||||
}
|
||||
//#endif
|
||||
#endif
|
||||
return
|
||||
}
|
||||
guard let messageList = try? JSONDecoder().decode([MessageModel].self, from: data) else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue