From e609261ef30bcee40f5962003cd02ca873f32919 Mon Sep 17 00:00:00 2001 From: Matthew Fennell Date: Mon, 12 Aug 2024 21:29:53 +0100 Subject: [PATCH] Make deviceId a computed property --- Monal/Classes/OmemoKeys.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Monal/Classes/OmemoKeys.swift b/Monal/Classes/OmemoKeys.swift index 7157c3f8d..b2e049088 100644 --- a/Monal/Classes/OmemoKeys.swift +++ b/Monal/Classes/OmemoKeys.swift @@ -196,11 +196,14 @@ struct OmemoKeysEntry: View { } struct OmemoKeysForContact: View { - @State private var deviceId: NSNumber @State private var deviceIds: OrderedSet @State private var showDeleteKeyAlert = false @State private var selectedDeviceForDeletion : NSNumber + private var deviceId: NSNumber { + return account.omemo.getDeviceId() + } + private let contactJid: String private let account: xmpp private let ownKeys: Bool @@ -209,7 +212,6 @@ struct OmemoKeysForContact: View { self.ownKeys = (account.connectionProperties.identity.jid == contact.obj.contactJid) self.contactJid = contact.obj.contactJid self.account = account - self.deviceId = account.omemo.getDeviceId() self.deviceIds = OmemoKeysForContact.knownDevices(account: self.account, jid: self.contactJid) self.selectedDeviceForDeletion = -1 }