From 4d8e42fc6b7eafefc8584645caac00d4cbeee714 Mon Sep 17 00:00:00 2001 From: Oliver Wiese <oliver.wiese@fu-berlin.de> Date: Sat, 4 Apr 2020 12:52:50 +0200 Subject: [PATCH] fix cycle bug --- enzevalos_iphone/SwiftUI/Inbox/Inbox.swift | 1 - enzevalos_iphone/SwiftUI/Inbox/KeyRecordRow.swift | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/enzevalos_iphone/SwiftUI/Inbox/Inbox.swift b/enzevalos_iphone/SwiftUI/Inbox/Inbox.swift index 06e10bf3..b68963eb 100644 --- a/enzevalos_iphone/SwiftUI/Inbox/Inbox.swift +++ b/enzevalos_iphone/SwiftUI/Inbox/Inbox.swift @@ -48,7 +48,6 @@ struct Inbox: View { private var mailList: some View { List (self.keyrecords.filter(filterKeyRecord), id: \.self){ record in - //KeyRecordRow(keyrecord: record, coord: self.coord) KeyRecordRow(keyrecord: record) } .resignKeyboardOnDragGesture() // hide keyboard when dragging diff --git a/enzevalos_iphone/SwiftUI/Inbox/KeyRecordRow.swift b/enzevalos_iphone/SwiftUI/Inbox/KeyRecordRow.swift index 2efe5c1a..791fe7b2 100644 --- a/enzevalos_iphone/SwiftUI/Inbox/KeyRecordRow.swift +++ b/enzevalos_iphone/SwiftUI/Inbox/KeyRecordRow.swift @@ -11,14 +11,16 @@ import SwiftUI struct KeyRecordRow: View { private static let coord = AppDelegate.getAppDelegate().inboxCoordinator - var keyrecord: KeyRecord + let keyrecord: KeyRecord var first: PersistentMail? var second: PersistentMail? + let name: String init(keyrecord: KeyRecord) { self.keyrecord = keyrecord first = keyrecord.firstMail second = keyrecord.secondMail + name = keyrecord.name } @@ -31,7 +33,7 @@ struct KeyRecordRow: View { .offset(y: -10) } HStack { - name + nameView Spacer() moreMails } @@ -76,8 +78,8 @@ struct KeyRecordRow: View { } } - private var name: some View { - Text(self.keyrecord.myNick) + private var nameView: some View { + Text(name) .frame(maxWidth: 300, alignment: .leading) .lineLimit(1) .onTapGesture { -- GitLab