Skip to content

Commit

Permalink
fix typage
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantgillespie committed Jul 25, 2024
1 parent bd3d72b commit c09e482
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/Block/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const href = computed(() => {
<template>
<BaseButton
v-if="block"
v-capture="block.ph_event ? { name: block.ph_event, properties: { block } } : undefined"
v-capture="block.ph_event ? { name: block.ph_event, properties: { block } } : ''"
:href="href"
:color="block.color"
:icon="block.icon ?? undefined"
Expand Down
4 changes: 2 additions & 2 deletions components/PageBuilder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export interface PageSectionBlock {
spacing: 'none' | 'x-small' | 'small' | 'medium' | 'large' | 'x-large';
width: 'full' | 'standard' | 'narrow';
key: string | null;
experiment: Experiment;
experiment_variant: ExperimentVariant;
experiment?: Experiment | string | null;
experiment_variant?: ExperimentVariant | string | null;
}
withDefaults(defineProps<PageBuilderProps>(), {
Expand Down
2 changes: 1 addition & 1 deletion modules/posthog/runtime/directives/v-capture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const directive: FunctionDirective<HTMLElement, CaptureEvent | string> = (
const { value, modifiers } = binding;

// Don't bind if the value is undefined
if (value === undefined) {
if (!value) {
return;
}

Expand Down
5 changes: 3 additions & 2 deletions pages/[...permalink].vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,16 @@ const sections = computed(() => {
spacing: block.spacing,
background: block.background,
negativeTopMargin: block.negative_offset,
blocks: [block],
// @TODO type
blocks: [block as any],
});
} else {
// Adjust spacing if needed and add block to current section
if (block.spacing !== section.spacing) {
section.spacing = 'medium';
}
section.blocks.push(block);
section.blocks.push(block as any);
}
return acc;
Expand Down
2 changes: 1 addition & 1 deletion types/schema/blocks/block-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export interface BlockButton {
external_url: string | null;
icon: string | null;
size: 'small' | 'medium' | 'large' | 'x-large';
ph_event: string | null;
ph_event: any;
}

0 comments on commit c09e482

Please sign in to comment.