mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-09 21:07:49 +00:00
add an early-return to getHrefContainerProps to avoid similar bugs
This commit is contained in:
@@ -99,6 +99,9 @@ globalThis.handleHrefContainerClick = (e: MouseEvent) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export function getHrefContainerProps(href: string) {
|
export function getHrefContainerProps(href: string) {
|
||||||
|
// If the href is null or empty, no props should be added
|
||||||
|
if (!href) return {};
|
||||||
|
|
||||||
// hack to detect whether the function is in an Astro or Preact environment,
|
// hack to detect whether the function is in an Astro or Preact environment,
|
||||||
// assuming that Preact is only used outside of a node environment
|
// assuming that Preact is only used outside of a node environment
|
||||||
if (
|
if (
|
||||||
|
|||||||
Reference in New Issue
Block a user