From 86e968fabd725b189def1e9e51f0c937fa604c66 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Tue, 20 Feb 2024 15:26:05 +0100 Subject: [PATCH] Don't reload content all the time (IOS-192) --- .../Header/View/ProfileHeaderView+ViewModel.swift | 6 ------ Mastodon/Scene/Profile/ProfileViewModel.swift | 12 +++++------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Mastodon/Scene/Profile/Header/View/ProfileHeaderView+ViewModel.swift b/Mastodon/Scene/Profile/Header/View/ProfileHeaderView+ViewModel.swift index a292e75ea..809eb9a4c 100644 --- a/Mastodon/Scene/Profile/Header/View/ProfileHeaderView+ViewModel.swift +++ b/Mastodon/Scene/Profile/Header/View/ProfileHeaderView+ViewModel.swift @@ -56,12 +56,6 @@ extension ProfileHeaderView { self.account = account self.me = me self.relationship = relationship - - #warning("TODO: Implement") -// $relationshipActionOptionSet -// .compactMap { $0.highPriorityAction(except: []) } -// .map { $0 == .none } -// .assign(to: &$isRelationshipActionButtonHidden) } } } diff --git a/Mastodon/Scene/Profile/ProfileViewModel.swift b/Mastodon/Scene/Profile/ProfileViewModel.swift index 9a8b567ae..76969dedc 100644 --- a/Mastodon/Scene/Profile/ProfileViewModel.swift +++ b/Mastodon/Scene/Profile/ProfileViewModel.swift @@ -84,13 +84,11 @@ class ProfileViewModel: NSObject { self.profileAboutViewModel = ProfileAboutViewModel(context: context, account: account) super.init() - // bind user - $account - .map { user -> UserIdentifier? in - guard let domain = account.domain else { return nil } - return MastodonUserIdentifier(domain: domain, userID: account.id) - } - .assign(to: &$userIdentifier) + if let domain = account.domain { + userIdentifier = MastodonUserIdentifier(domain: domain, userID: account.id) + } else { + userIdentifier = nil + } // bind userIdentifier $userIdentifier.assign(to: &postsUserTimelineViewModel.$userIdentifier)