From 67d0ca700f729818d3b51385c9dd1e454dc4f910 Mon Sep 17 00:00:00 2001 From: Philippe PITTOLI Date: Sun, 28 Apr 2024 00:25:39 +0200 Subject: [PATCH] When receiving DomainChanged: change or add the domain to you domain list. --- src/App/Page/DomainList.purs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App/Page/DomainList.purs b/src/App/Page/DomainList.purs index 4aae597..b1333e9 100644 --- a/src/App/Page/DomainList.purs +++ b/src/App/Page/DomainList.purs @@ -407,7 +407,10 @@ handleQuery = case _ of handleAction $ UpdateMyDomains (my_domains <> [ emptyDomainInfo { name = response.domain } ]) (DNSManager.MkDomainChanged response) -> do { my_domains } <- H.get - let new_domains = map (\d -> if d.name == response.domain.name then response.domain else d) my_domains + let replaced_domains = map (\d -> if d.name == response.domain.name then response.domain else d) my_domains + new_domains = if A.elem response.domain replaced_domains + then replaced_domains + else replaced_domains <> [response.domain] handleAction $ UpdateMyDomains new_domains (DNSManager.MkDomainDeleted response) -> do { my_domains } <- H.get