Whitelist link previews client side
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
parent
d8f1944b27
commit
33e58dbca9
|
@ -2474,7 +2474,9 @@
|
||||||
:link-preview/whitelist
|
:link-preview/whitelist
|
||||||
:<- [:multiaccount]
|
:<- [:multiaccount]
|
||||||
(fn [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
|
(re-frame/reg-sub
|
||||||
:link-preview/cache
|
:link-preview/cache
|
||||||
|
|
|
@ -22,7 +22,8 @@
|
||||||
[::link-preview/enable title ((complement boolean) enabled?)])})))
|
[::link-preview/enable title ((complement boolean) enabled?)])})))
|
||||||
|
|
||||||
(views/defview link-previews-settings []
|
(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}
|
[react/view {:flex 1}
|
||||||
[topbar/topbar {:title (i18n/label :t/chat-link-previews)}]
|
[topbar/topbar {:title (i18n/label :t/chat-link-previews)}]
|
||||||
[react/image {:source (resources/get-theme-image :unfurl)
|
[react/image {:source (resources/get-theme-image :unfurl)
|
||||||
|
|
|
@ -141,3 +141,5 @@
|
||||||
[id network])
|
[id network])
|
||||||
default-networks)))
|
default-networks)))
|
||||||
|
|
||||||
|
(def link-preview-enabled-site?
|
||||||
|
#{"youtube.com" "youtu.be"})
|
||||||
|
|
Loading…
Reference in New Issue