diff --git a/platform/wab/src/wab/client/components/sidebar-tabs/ProjectPanel/NavigationRows.tsx b/platform/wab/src/wab/client/components/sidebar-tabs/ProjectPanel/NavigationRows.tsx index 627e4988357..362f4c1ab7a 100644 --- a/platform/wab/src/wab/client/components/sidebar-tabs/ProjectPanel/NavigationRows.tsx +++ b/platform/wab/src/wab/client/components/sidebar-tabs/ProjectPanel/NavigationRows.tsx @@ -66,10 +66,10 @@ export function NavigationHeaderRow({ { e.stopPropagation(); + await onAdd(); if (!props.isOpen) { toggleExpand(); } - await onAdd(); }} > diff --git a/platform/wab/src/wab/client/components/sidebar/TokenTypeHeader.tsx b/platform/wab/src/wab/client/components/sidebar/TokenTypeHeader.tsx index ce422ec3201..cfda56ea05f 100644 --- a/platform/wab/src/wab/client/components/sidebar/TokenTypeHeader.tsx +++ b/platform/wab/src/wab/client/components/sidebar/TokenTypeHeader.tsx @@ -6,7 +6,6 @@ import PlasmicTokenTypeHeader, { } from "@/wab/client/plasmic/plasmic_kit_left_pane/PlasmicTokenTypeHeader"; import { useStudioCtx } from "@/wab/client/studio-ctx/StudioCtx"; import { TokenType, tokenTypeLabel } from "@/wab/commons/StyleToken"; -import { spawn } from "@/wab/shared/common"; import { canCreateAlias } from "@/wab/shared/ui-config-utils"; import { MultiChoiceArg } from "@plasmicapp/react-web"; import * as React from "react"; @@ -67,12 +66,12 @@ function TokenTypeHeader(props: TokenTypeHeaderProps) { ? { render: () => null } : { props: { - onClick: (e) => { + onClick: async (e) => { e.stopPropagation(); + await tokenControls.onAdd(tokenType); if (!isExpanded) { toggleExpand(); } - spawn(tokenControls.onAdd(tokenType)); }, }, }