minor refactor on threadIsNoteToSelf

pull/941/head
ryanzhao 1 year ago
parent 6694414f55
commit 23459fee2d

@ -361,8 +361,7 @@ final class ConversationVC: BaseVC, ConversationSearchControllerDelegate, UITabl
// nav will be offset incorrectly during the push animation (unfortunately the profile icon still // nav will be offset incorrectly during the push animation (unfortunately the profile icon still
// doesn't appear until after the animation, I assume it's taking a snapshot or something, but // doesn't appear until after the animation, I assume it's taking a snapshot or something, but
// there isn't much we can do about that unfortunately) // there isn't much we can do about that unfortunately)
let isNoteToSelf: Bool = self.viewModel.threadData.threadId == getUserHexEncodedPublicKey() updateNavBarButtons(threadData: nil, initialVariant: self.viewModel.initialThreadVariant, isNoteToSelf: self.viewModel.threadData.threadIsNoteToSelf)
updateNavBarButtons(threadData: nil, initialVariant: self.viewModel.initialThreadVariant, isNoteToSelf: isNoteToSelf)
titleView.initialSetup(with: self.viewModel.initialThreadVariant) titleView.initialSetup(with: self.viewModel.initialThreadVariant)
// Constraints // Constraints

@ -104,6 +104,7 @@ public class ConversationViewModel: OWSAudioPlayerDelegate {
public private(set) lazy var threadData: SessionThreadViewModel = SessionThreadViewModel( public private(set) lazy var threadData: SessionThreadViewModel = SessionThreadViewModel(
threadId: self.threadId, threadId: self.threadId,
threadVariant: self.initialThreadVariant, threadVariant: self.initialThreadVariant,
threadIsNoteToSelf: (self.threadId == getUserHexEncodedPublicKey()),
currentUserIsClosedGroupMember: (self.initialThreadVariant != .closedGroup ? currentUserIsClosedGroupMember: (self.initialThreadVariant != .closedGroup ?
nil : nil :
Storage.shared.read { db in Storage.shared.read { db in

Loading…
Cancel
Save