mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-03 01:18:38 +00:00
Fix tracking empty preset code in init routes
Guard against tracking an empty preset value in both /init and /init/v0 routes. When no valid preset code is in the URL, getPresetCode encodes one from the parsed config params. The conditional spread ensures an empty string never reaches analytics. https://claude.ai/code/session_018Mm7WJAaSUGSqamSm3RiyC
This commit is contained in:
@@ -25,7 +25,7 @@ export async function GET(request: NextRequest) {
|
||||
after(() => {
|
||||
track("create_open_in_v0", {
|
||||
...result.data,
|
||||
preset: presetCode,
|
||||
...(presetCode && { preset: presetCode }),
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user