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.
Published at
2023-06-10 10:48:56Event JSON
{
"id": "bb5ba5b97f5646acc519acb7a3d92a595947b4fd6227625cdd3aac7242d8da75",
"pubkey": "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245",
"created_at": 1686394136,
"kind": 1,
"tags": [
[
"e",
"dee0b78706bc1cd076939d55e2f16283b174582b3083cecdb13e154348e56a30"
],
[
"p",
"edf16b1dd61eab353a83af470cc13557029bff6827b4cb9b7fc9bdb632a2b8e6"
],
[
"p",
"07ecf9838136fe430fac43fa0860dbc62a0aac0729c5a33df1192ce75e330c9f"
]
],
"content": "nostr:npub1qlk0nqupxmlyxravg0aqscxmcc4q4tq898z6x003rykwwh3npj0syvyayc nice! Some comments:\n\n\u003e diff --git a/damus/Views/Relays/RelayDetailView.swift b/damus/Views/Relays/RelayDetailView.swift\n\u003e index c53bc123..7606799d 100644\n\u003e --- a/damus/Views/Relays/RelayDetailView.swift\n\u003e +++ b/damus/Views/Relays/RelayDetailView.swift\n\u003e @@ -12,8 +12,18 @@ struct RelayDetailView: View {\n\u003e let relay: String\n\u003e let nip11: RelayMetadata\n\u003e \n\u003e + @StateObject var log: RelayLog\n\nI'm not sure this will work as a StateObject. When the view disappears,\nRelayLog will get deallocated and the writeToDisk callbacks will be\ndeallocated as well.\n\nIdeally we would create a RelayModel that would replace the\nRelayMetadata in RelayMetadatas. Then the RelayModel would contain\nRelayMetadata, RelayLog, etc. Composing multiple ObservableObjects into\none is a bit annoying so perhaps we can move some of the publisher stuff\ninto the RelayModel instead.",
"sig": "ce73a439b710f6c4be60ba456149a017d803463eee3365e7f3f373df62a877f20045f359cece04262a0f2160e5149f29f812d94cfe48a5ebdf27f000dd453b7d"
}