diff --git a/web/shared/JsonSchema.tsx b/web/shared/JsonSchema.tsx index 1ef9c11b8..a68db89d5 100644 --- a/web/shared/JsonSchema.tsx +++ b/web/shared/JsonSchema.tsx @@ -77,6 +77,19 @@ export const JsonSchema: Component<{ return { name: value, disabled: f.disabled, type: f.type } } if (field === 'disabled') return { name: f.name, disabled: !value, type: f.type } + if (field === 'enum') { + return { + name: f.name, + disabled: f.disabled, + type: { + ...f.type, + enum: (value || '') + .split(',') + .map((t: string) => t.trim()) + .filter((v: string) => !!v), + }, + } + } return { name: f.name, @@ -147,6 +160,7 @@ const SchemaField: Component<{ { label: 'Boolean', value: 'bool' }, { label: 'String', value: 'string' }, { label: 'Number', value: 'integer' }, + { label: 'Enum', value: 'enum' }, ]} fieldName={`${props.index}.type`} value={props.def.type} @@ -223,7 +237,7 @@ const SchemaField: Component<{
- + diff --git a/web/shared/Slot.tsx b/web/shared/Slot.tsx index d7605356e..e5cb54501 100644 --- a/web/shared/Slot.tsx +++ b/web/shared/Slot.tsx @@ -14,6 +14,8 @@ import { getPagePlatform, getWidthPlatform, useEffect, useResizeObserver } from import { getUserSubscriptionTier, wait } from '/common/util' import { createDebounce } from './util' +const win: any = window + window.googletag = window.googletag || { cmd: [] } window.ezstandalone = window.ezstandalone || { cmd: [] } window.fusetag = window.fusetag || { que: [] } @@ -99,7 +101,13 @@ const Slot: Component<{ const tier = createMemo(() => { if (!user.user) return - return getUserSubscriptionTier(user.user, user.tiers) + const subtier = getUserSubscriptionTier(user.user, user.tiers) + + if (subtier?.tier.disableSlots) { + win.enableSticky = undefined + } + + return subtier }) const id = createMemo(() => { @@ -525,7 +533,6 @@ function toPixels(size: string) { return {} } -const win: any = window win.getSlotById = getSlotById export function getSlotById(id: string) { @@ -704,6 +711,8 @@ const [invokeFuse] = createDebounce(() => { if (!status) return const ids = Array.from(FuseIds.values()) console.log(`[fuse] init ${ids}`) + const win: any = window + win.enableSticky = true window.fusetag.que.push(() => { window.fusetag.pageInit({ blockingFuseIds: ids }) })