fix: guard Drawfast tool with feature flag in overrides
Drawfast was always included in overrides.tsx but is conditional in Board.tsx (dev-only). This caused "l is not a function" errors when users tried to select tools in production since the Drawfast tool wasn't registered. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
486e75d02a
commit
00aa0828c4
|
|
@ -34,6 +34,7 @@ import { llm, getApiKey } from "@/utils/llmUtils"
|
||||||
const IS_PRODUCTION = import.meta.env.PROD
|
const IS_PRODUCTION = import.meta.env.PROD
|
||||||
const ENABLE_WORKFLOW = !IS_PRODUCTION // Workflow blocks - dev only
|
const ENABLE_WORKFLOW = !IS_PRODUCTION // Workflow blocks - dev only
|
||||||
const ENABLE_CALENDAR = !IS_PRODUCTION // Calendar - dev only
|
const ENABLE_CALENDAR = !IS_PRODUCTION // Calendar - dev only
|
||||||
|
const ENABLE_DRAWFAST = !IS_PRODUCTION // Drawfast - dev only
|
||||||
|
|
||||||
export const overrides: TLUiOverrides = {
|
export const overrides: TLUiOverrides = {
|
||||||
tools(editor, tools) {
|
tools(editor, tools) {
|
||||||
|
|
@ -227,14 +228,17 @@ export const overrides: TLUiOverrides = {
|
||||||
readonlyOk: true,
|
readonlyOk: true,
|
||||||
onSelect: () => editor.setCurrentTool("VideoGen"),
|
onSelect: () => editor.setCurrentTool("VideoGen"),
|
||||||
},
|
},
|
||||||
Drawfast: {
|
// Drawfast - only available in dev (must match ENABLE_DRAWFAST flag in Board.tsx)
|
||||||
id: "Drawfast",
|
...(ENABLE_DRAWFAST ? {
|
||||||
icon: "tool-pencil",
|
Drawfast: {
|
||||||
label: "Drawfast (AI Sketch)",
|
id: "Drawfast",
|
||||||
kbd: "ctrl+shift+d",
|
icon: "tool-pencil",
|
||||||
readonlyOk: true,
|
label: "Drawfast (AI Sketch)",
|
||||||
onSelect: () => editor.setCurrentTool("Drawfast"),
|
kbd: "ctrl+shift+d",
|
||||||
},
|
readonlyOk: true,
|
||||||
|
onSelect: () => editor.setCurrentTool("Drawfast"),
|
||||||
|
},
|
||||||
|
} : {}),
|
||||||
Multmux: {
|
Multmux: {
|
||||||
id: "Multmux",
|
id: "Multmux",
|
||||||
icon: "terminal",
|
icon: "terminal",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue