🔧 Gate cap with config flag

This commit is contained in:
Belén Albeza 2025-05-28 14:07:36 +02:00
parent 7d5739b663
commit c0a98288d0
2 changed files with 3 additions and 1 deletions

View file

@ -71,6 +71,7 @@ test.describe("Shape attributes", () => {
page, page,
}) => { }) => {
const workspace = new WorkspacePage(page); const workspace = new WorkspacePage(page);
await workspace.mockConfigFlags(["enable-binary-fills"]);
await workspace.setupEmptyFile(); await workspace.setupEmptyFile();
await workspace.mockRPC(/get\-file\?/, "design/get-file-fills-limit.json"); await workspace.mockRPC(/get\-file\?/, "design/get-file-fills-limit.json");

View file

@ -12,6 +12,7 @@
[app.common.types.color :as ctc] [app.common.types.color :as ctc]
[app.common.types.shape :as shp] [app.common.types.shape :as shp]
[app.common.types.shape.attrs :refer [default-color]] [app.common.types.shape.attrs :refer [default-color]]
[app.config :as cfg]
[app.main.data.workspace.colors :as dc] [app.main.data.workspace.colors :as dc]
[app.main.store :as st] [app.main.store :as st]
[app.main.ui.components.title-bar :refer [title-bar]] [app.main.ui.components.title-bar :refer [title-bar]]
@ -55,7 +56,7 @@
values (d/without-nils values) values (d/without-nils values)
fills (:fills values) fills (:fills values)
has-fills? (or (= :multiple fills) (some? (seq fills))) has-fills? (or (= :multiple fills) (some? (seq fills)))
can-add-fills? (and (not (= :multiple fills)) (< (count fills) shp/MAX-FILLS)) can-add-fills? (and (contains? cfg/flags :binary-fills) (not (= :multiple fills)) (< (count fills) shp/MAX-FILLS))
state* (mf/use-state has-fills?) state* (mf/use-state has-fills?)
open? (deref state*) open? (deref state*)