0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 00:10:11 -05:00

🐛 Fix image layer filter

This commit is contained in:
Eva Marco 2024-03-21 16:23:59 +01:00 committed by Andrey Antukh
parent 1d726249d0
commit d8a6abfb88

View file

@ -10,6 +10,7 @@
[app.common.data :as d] [app.common.data :as d]
[app.common.data.macros :as dm] [app.common.data.macros :as dm]
[app.common.files.helpers :as cfh] [app.common.files.helpers :as cfh]
[app.common.types.shape :as cts]
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[app.main.data.workspace :as dw] [app.main.data.workspace :as dw]
[app.main.refs :as refs] [app.main.refs :as refs]
@ -147,7 +148,10 @@
(or (empty? filters) (or (empty? filters)
(and (contains? filters :component) (and (contains? filters :component)
(contains? shape :component-id)) (contains? shape :component-id))
(let [direct-filters (into #{} (filter #{:frame :rect :circle :path :bool :image :text}) filters)] (and (contains? filters :image)
(some? (cts/has-images? shape)))
(let [direct-filters (into #{} (filter #{:frame :rect :circle :path :bool :text}) filters)]
(contains? direct-filters (:type shape))) (contains? direct-filters (:type shape)))
(and (contains? filters :group) (and (contains? filters :group)
(and (cfh/group-shape? shape) (and (cfh/group-shape? shape)
@ -166,7 +170,6 @@
:filters #{} :filters #{}
:num-items 100}) :num-items 100})
state (deref state*) state (deref state*)
current-filters (:filters state) current-filters (:filters state)
current-items (:num-items state) current-items (:num-items state)
current-search (:search-text state) current-search (:search-text state)