jb55 on Nostr: montzstar nice! Some comments: > diff --git ...
montzstar (npub1qlk…yayc) nice! Some comments:
> diff --git a/damus/Views/Relays/RelayDetailView.swift b/damus/Views/Relays/RelayDetailView.swift
> index c53bc123..7606799d 100644
> --- a/damus/Views/Relays/RelayDetailView.swift
> +++ b/damus/Views/Relays/RelayDetailView.swift
> @@ -12,8 +12,18 @@ struct RelayDetailView: View {
> let relay: String
> let nip11: RelayMetadata
>
> + @StateObject var log: RelayLog
I'm not sure this will work as a StateObject. When the view disappears,
RelayLog will get deallocated and the writeToDisk callbacks will be
deallocated as well.
Ideally we would create a RelayModel that would replace the
RelayMetadata in RelayMetadatas. Then the RelayModel would contain
RelayMetadata, RelayLog, etc. Composing multiple ObservableObjects into
one is a bit annoying so perhaps we can move some of the publisher stuff
into the RelayModel instead.
> diff --git a/damus/Views/Relays/RelayDetailView.swift b/damus/Views/Relays/RelayDetailView.swift
> index c53bc123..7606799d 100644
> --- a/damus/Views/Relays/RelayDetailView.swift
> +++ b/damus/Views/Relays/RelayDetailView.swift
> @@ -12,8 +12,18 @@ struct RelayDetailView: View {
> let relay: String
> let nip11: RelayMetadata
>
> + @StateObject var log: RelayLog
I'm not sure this will work as a StateObject. When the view disappears,
RelayLog will get deallocated and the writeToDisk callbacks will be
deallocated as well.
Ideally we would create a RelayModel that would replace the
RelayMetadata in RelayMetadatas. Then the RelayModel would contain
RelayMetadata, RelayLog, etc. Composing multiple ObservableObjects into
one is a bit annoying so perhaps we can move some of the publisher stuff
into the RelayModel instead.