diff --git a/CHANGELOG.md b/CHANGELOG.md index 664f253af..fca3234ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added ability to delete lists. [#136](https://github.com/verse-pbc/issues/issues/136) - Added analytics for feed source selection and lists. [#129](https://github.com/verse-pbc/issues/issues/129) - Fixed: while searching for users to add to a list, NIP-05 searches dismiss the view. [#165](https://github.com/verse-pbc/issues/issues/165) -- Fixed a performance issue that could occur after switching tabs. [#171](https://github.com/verse-pbc/issues/issues/171) - Fixed a crash when processing a malformed delete (kind 5) event. [#170](https://github.com/verse-pbc/issues/issues/170) ### Internal Changes diff --git a/Nos/Views/Components/Author/AuthorCard.swift b/Nos/Views/Components/Author/AuthorCard.swift index 89f10bbc6..18ad9009c 100644 --- a/Nos/Views/Components/Author/AuthorCard.swift +++ b/Nos/Views/Components/Author/AuthorCard.swift @@ -15,7 +15,7 @@ enum AvatarOverlayMode { /// This view displays the information we have for an author suitable for being used in a list. struct AuthorCard: View { - var author: Author + @ObservedObject var author: Author @Environment(CurrentUser.self) var currentUser let avatarOverlayView: () -> AvatarOverlay? diff --git a/Nos/Views/Components/Author/AuthorLabel.swift b/Nos/Views/Components/Author/AuthorLabel.swift index ec25d9468..0ac212483 100644 --- a/Nos/Views/Components/Author/AuthorLabel.swift +++ b/Nos/Views/Components/Author/AuthorLabel.swift @@ -2,7 +2,7 @@ import SwiftUI struct AuthorLabel: View { - var author: Author + @ObservedObject var author: Author var note: Event? private var attributedAuthor: AttributedString { diff --git a/Nos/Views/Components/Author/NIP05View.swift b/Nos/Views/Components/Author/NIP05View.swift index 7d2e3230e..b9294e164 100644 --- a/Nos/Views/Components/Author/NIP05View.swift +++ b/Nos/Views/Components/Author/NIP05View.swift @@ -4,7 +4,7 @@ import SwiftUI /// Displays a user's NIP-05 in multiple colors and does some verification on it. struct NIP05View: View { - var author: Author + @ObservedObject var author: Author @State private var verifiedNip05Identifier: Bool? @Dependency(\.namesAPI) private var namesAPI diff --git a/Nos/Views/Components/BioView.swift b/Nos/Views/Components/BioView.swift index 7e2d59a10..e555b66b0 100644 --- a/Nos/Views/Components/BioView.swift +++ b/Nos/Views/Components/BioView.swift @@ -3,7 +3,7 @@ import SwiftUI struct BioView: View { - var author: Author + @ObservedObject var author: Author @Environment(\.managedObjectContext) private var viewContext diff --git a/Nos/Views/Components/Button/CircularButton.swift b/Nos/Views/Components/Button/CircularButton.swift index 75af409b9..55b4610dc 100644 --- a/Nos/Views/Components/Button/CircularButton.swift +++ b/Nos/Views/Components/Button/CircularButton.swift @@ -7,7 +7,7 @@ import SwiftUI /// Allows the current user to follow or unfollow the author, /// and updates its own appearance based on follow state. struct CircularFollowButton: View { - var author: Author + @ObservedObject var author: Author @Environment(CurrentUser.self) private var currentUser @Dependency(\.analytics) private var analytics @Dependency(\.crashReporting) private var crashReporting diff --git a/Nos/Views/Components/Button/FollowButton.swift b/Nos/Views/Components/Button/FollowButton.swift index 66e41b1ae..e13e9e17e 100644 --- a/Nos/Views/Components/Button/FollowButton.swift +++ b/Nos/Views/Components/Button/FollowButton.swift @@ -4,7 +4,7 @@ import CoreData struct FollowButton: View { @ObservedObject var currentUserAuthor: Author - var author: Author + @ObservedObject var author: Author /// A flag used to show a follow or unfollow icon in addition to Follow or /// Unfollow text. var shouldDisplayIcon = false diff --git a/Nos/Views/Components/GoldenPostView.swift b/Nos/Views/Components/GoldenPostView.swift index 2e96cfeef..53f923998 100644 --- a/Nos/Views/Components/GoldenPostView.swift +++ b/Nos/Views/Components/GoldenPostView.swift @@ -5,7 +5,7 @@ let goldenRatio: CGFloat = 0.618 struct GoldenPostView: View { - var author: Author + @ObservedObject var author: Author @ObservedObject var note: Event @EnvironmentObject private var router: Router diff --git a/Nos/Views/Components/KnownFollowersView.swift b/Nos/Views/Components/KnownFollowersView.swift index 13ab9f7bc..b10a9f778 100644 --- a/Nos/Views/Components/KnownFollowersView.swift +++ b/Nos/Views/Components/KnownFollowersView.swift @@ -5,7 +5,7 @@ import SwiftUI /// impersonation attacks by making sure they choose the right person to follow, mention, message, etc. struct KnownFollowersView: View { - var author: Author + @ObservedObject var author: Author /// The authors that the `source` author follows who also follow the `author` @FetchRequest private var knownFollowers: FetchedResults diff --git a/Nos/Views/Home/HomeTab.swift b/Nos/Views/Home/HomeTab.swift index 1b0e6def0..e61fda4fc 100644 --- a/Nos/Views/Home/HomeTab.swift +++ b/Nos/Views/Home/HomeTab.swift @@ -56,7 +56,7 @@ fileprivate struct PopoverTipView: View { } struct HomeTab: View { - var user: Author + @ObservedObject var user: Author @EnvironmentObject private var router: Router @ObserveInjection var inject diff --git a/Nos/Views/Note/NoteCardHeader.swift b/Nos/Views/Note/NoteCardHeader.swift index 3f0fe8442..beb935043 100644 --- a/Nos/Views/Note/NoteCardHeader.swift +++ b/Nos/Views/Note/NoteCardHeader.swift @@ -3,7 +3,7 @@ import SwiftUI struct NoteCardHeader: View { @ObservedObject var note: Event - var author: Author + @ObservedObject var author: Author var body: some View { HStack(alignment: .center, spacing: 8) { diff --git a/Nos/Views/Profile/ActivityPubBadgeView.swift b/Nos/Views/Profile/ActivityPubBadgeView.swift index 44ccd11ce..09ba5ec2d 100644 --- a/Nos/Views/Profile/ActivityPubBadgeView.swift +++ b/Nos/Views/Profile/ActivityPubBadgeView.swift @@ -3,7 +3,7 @@ import SwiftUI /// A view that displays a badge with an ActivityPub icon. struct ActivityPubBadgeView: View { - var author: Author + @ObservedObject var author: Author var fediverseServer: String { let regex = /[0-9A-Za-z._-]+@(?[0-9A-Za-z._-]+)\.mostr\.pub/ diff --git a/Nos/Views/Profile/BioSheet.swift b/Nos/Views/Profile/BioSheet.swift index dd9afa760..9bc0c31aa 100644 --- a/Nos/Views/Profile/BioSheet.swift +++ b/Nos/Views/Profile/BioSheet.swift @@ -3,7 +3,7 @@ import SwiftUI /// Shows the name, nip-05 and bio of a given user in a vertical stack. struct BioSheet: View { - var author: Author + @ObservedObject var author: Author @Environment(\.managedObjectContext) private var viewContext @Dependency(\.noteParser) private var noteParser diff --git a/Nos/Views/Profile/Edit/ProfileEditView.swift b/Nos/Views/Profile/Edit/ProfileEditView.swift index 752789c1a..8aa214096 100644 --- a/Nos/Views/Profile/Edit/ProfileEditView.swift +++ b/Nos/Views/Profile/Edit/ProfileEditView.swift @@ -16,7 +16,7 @@ struct ProfileEditView: View { @Dependency(\.crashReporting) private var crashReporting - var author: Author + @ObservedObject var author: Author @State private var displayNameText: String = "" @State private var bioText: String = "" diff --git a/Nos/Views/Profile/ProfileHeader.swift b/Nos/Views/Profile/ProfileHeader.swift index 5f92de9c1..e5c73dcb0 100644 --- a/Nos/Views/Profile/ProfileHeader.swift +++ b/Nos/Views/Profile/ProfileHeader.swift @@ -3,7 +3,7 @@ import CoreData import Logger struct ProfileHeader: View { - var author: Author + @ObservedObject var author: Author @Environment(CurrentUser.self) private var currentUser @Binding private var selectedTab: ProfileFeedType diff --git a/Nos/Views/Profile/ProfileTab.swift b/Nos/Views/Profile/ProfileTab.swift index 935006827..05ab71b46 100644 --- a/Nos/Views/Profile/ProfileTab.swift +++ b/Nos/Views/Profile/ProfileTab.swift @@ -5,7 +5,7 @@ import SwiftUI struct ProfileTab: View { @Environment(CurrentUser.self) var currentUser - var author: Author + @ObservedObject var author: Author @Binding var path: NavigationPath diff --git a/Nos/Views/Profile/ProfileView.swift b/Nos/Views/Profile/ProfileView.swift index 4bc5c1f88..b12abf5a6 100644 --- a/Nos/Views/Profile/ProfileView.swift +++ b/Nos/Views/Profile/ProfileView.swift @@ -6,7 +6,7 @@ import Logger struct ProfileView: View { - var author: Author + @ObservedObject var author: Author var addDoubleTapToPop = false @Environment(\.managedObjectContext) private var viewContext diff --git a/Nos/Views/Relay/RelayView.swift b/Nos/Views/Relay/RelayView.swift index bb14165de..2825c6dd7 100644 --- a/Nos/Views/Relay/RelayView.swift +++ b/Nos/Views/Relay/RelayView.swift @@ -12,7 +12,7 @@ struct RelayView: View { @Environment(\.managedObjectContext) private var viewContext @Environment(RelayService.self) private var relayService @Environment(CurrentUser.self) private var currentUser - var author: Author + @ObservedObject var author: Author @State var newRelayAddress: String = ""