diff --git a/src/status_im/subs.cljs b/src/status_im/subs.cljs index c03b356950..f9261e9ab1 100644 --- a/src/status_im/subs.cljs +++ b/src/status_im/subs.cljs @@ -2474,7 +2474,9 @@ :link-preview/whitelist :<- [:multiaccount] (fn [multiaccount] - (get multiaccount :link-previews-whitelist))) + (filter (fn [{:keys [address]}] + (config/link-preview-enabled-site? address)) + (get multiaccount :link-previews-whitelist)))) (re-frame/reg-sub :link-preview/cache diff --git a/src/status_im/ui/screens/link_previews_settings/views.cljs b/src/status_im/ui/screens/link_previews_settings/views.cljs index 4e2677ef9a..cfd3b69a2b 100644 --- a/src/status_im/ui/screens/link_previews_settings/views.cljs +++ b/src/status_im/ui/screens/link_previews_settings/views.cljs @@ -22,7 +22,8 @@ [::link-preview/enable title ((complement boolean) enabled?)])}))) (views/defview link-previews-settings [] - (views/letsubs [{:keys [link-previews-whitelist link-previews-enabled-sites]} [:multiaccount]] + (views/letsubs [link-previews-whitelist [:link-preview/whitelist] + link-previews-enabled-sites [:link-preview/enabled-sites]] [react/view {:flex 1} [topbar/topbar {:title (i18n/label :t/chat-link-previews)}] [react/image {:source (resources/get-theme-image :unfurl) diff --git a/src/status_im/utils/config.cljs b/src/status_im/utils/config.cljs index d1934048ce..642b874b31 100644 --- a/src/status_im/utils/config.cljs +++ b/src/status_im/utils/config.cljs @@ -141,3 +141,5 @@ [id network]) default-networks))) +(def link-preview-enabled-site? + #{"youtube.com" "youtu.be"})