diff --git a/src/utils/parseIntents.ts b/src/utils/parseIntents.ts index 8fedd2c7..39c1b11b 100644 --- a/src/utils/parseIntents.ts +++ b/src/utils/parseIntents.ts @@ -42,7 +42,7 @@ function parseIntent( ): JSXNode | JSXNode[] { // Check if the node is a "falsy" node (ie. `null`, `undefined`, `false`, etc). const node = ( - !node_ ? { children: [], props: {}, tag() { } } : node_ + !node_ ? { children: [], props: {}, tag() {} } : node_ ) as JSXNode const props = (() => { @@ -55,13 +55,13 @@ function parseIntent( ? node.props.action.startsWith('http') ? node.props.action : parsePath( - node.props.action.startsWith('~') - ? options.initialBaseUrl + node.props.action.slice(1) - : options.baseUrl + node.props.action, - ) + - (options.search && !value?.startsWith(buttonPrefix.addCastAction) - ? `?${options.search}` - : '') + node.props.action.startsWith('~') + ? options.initialBaseUrl + node.props.action.slice(1) + : options.baseUrl + node.props.action, + ) + + (options.search && !value?.startsWith(buttonPrefix.addCastAction) + ? `?${options.search}` + : '') : undefined, children: node.children, index: counter.button++, @@ -76,7 +76,7 @@ function parseIntent( buttonProps.target = node.props.target?.startsWith('http') ? node.props.target : parsePath(options.baseUrl + node.props.target) + - (search ? `?${search}` : '') + (search ? `?${search}` : '') } return buttonProps