From e75791f6703ac413b31894bd98ff8ae3b301375c Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Wed, 9 Sep 2020 00:28:14 -0700 Subject: [PATCH] Refactoring --- ViewModels/Sources/ViewModels/RootViewModel.swift | 3 +-- Views/IdentitiesView.swift | 10 +++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ViewModels/Sources/ViewModels/RootViewModel.swift b/ViewModels/Sources/ViewModels/RootViewModel.swift index 7708239..afab8b6 100644 --- a/ViewModels/Sources/ViewModels/RootViewModel.swift +++ b/ViewModels/Sources/ViewModels/RootViewModel.swift @@ -54,8 +54,7 @@ public extension RootViewModel { identification.observationErrors .receive(on: RunLoop.main) - .map { [weak self] _ in self?.mostRecentlyUsedIdentityID } - .sink { [weak self] in self?.newIdentitySelected(id: $0) } + .sink { [weak self] _ in self?.newIdentitySelected(id: self?.mostRecentlyUsedIdentityID ) } .store(in: &cancellables) identification.service.updateLastUse() diff --git a/Views/IdentitiesView.swift b/Views/IdentitiesView.swift index 91c288c..4d7b9c0 100644 --- a/Views/IdentitiesView.swift +++ b/Views/IdentitiesView.swift @@ -77,13 +77,17 @@ private extension IdentitiesView { .font(.subheadline) .foregroundColor(.secondary) } else { - Text(identity.handle) - .font(.headline) - .foregroundColor(.secondary) if let instance = identity.instance { + CustomEmojiText( + text: instance.title, + emoji: [], + textStyle: .headline) Text(instance.uri) .font(.subheadline) .foregroundColor(.secondary) + } else { + Text(identity.handle) + .font(.headline) } } Spacer()