fix: handle unknown contract community (#20242)

Signed-off-by: yqrashawn <namy.19@gmail.com>
This commit is contained in:
yqrashawn 2024-05-29 19:35:52 +08:00 committed by GitHub
parent 5c3f25e617
commit 7d542cefb8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 10 deletions

View File

@ -44,7 +44,7 @@
(log/trace "Signal received" {:payload event-str})
(case type
"wallet"
(rf/dispatch [:wallet/signal-received event-js])
{:fx [[:dispatch [:wallet/signal-received event-js]]]}
"wakuv2.peerstats"
(debounce/debounce-and-dispatch [:wakuv2-peer-stats event-js] 1000)
@ -85,8 +85,10 @@
"community.found"
(let [community (transforms/js->clj event-js)]
(link-preview/cache-community-preview-data community)
{:fx [[:dispatch [:discover-community/maybe-found-unknown-contract-community community]]]})
{:fx [[:dispatch
[:chat.ui/cache-link-preview-data (link-preview/community-link (:id community))
community]]
[:dispatch [:discover-community/maybe-found-unknown-contract-community community]]]})
"status.updates.timedout"
(visibility-status-updates/handle-visibility-status-updates cofx (transforms/js->clj event-js))
@ -95,13 +97,13 @@
(pairing/handle-local-pairing-signals cofx (transforms/js->clj event-js))
"curated.communities.update"
(rf/dispatch [:fetched-contract-communities (transforms/js->clj event-js)])
{:fx [[:dispatch [:fetched-contract-communities (transforms/js->clj event-js)]]]}
"waku.backedup.profile"
(rf/dispatch [:profile/update-profile-from-backup (transforms/js->clj event-js)])
{:fx [[:dispatch [:profile/update-profile-from-backup (transforms/js->clj event-js)]]]}
"waku.backedup.settings"
(rf/dispatch [:profile/update-setting-from-backup (transforms/js->clj event-js)])
{:fx [[:dispatch [:profile/update-setting-from-backup (transforms/js->clj event-js)]]]}
"mediaserver.started"
{:db (assoc db :mediaserver/port (oops/oget event-js :port))}

View File

@ -46,10 +46,6 @@
:on-success [:chat.ui/link-preview-whitelist-received]
:on-error #(log/error "Failed to get link preview whitelist")})))
(defn cache-community-preview-data
[{:keys [id] :as community}]
(rf/dispatch [:chat.ui/cache-link-preview-data (community-link id) community]))
(rf/reg-event-fx :chat.ui/enable-link-previews
(fn [{{:profile/keys [profile]} :db} [site enabled?]]
(let [enabled-sites (if enabled?