Skip to content

Commit ed115d8

Browse files
committed
fix(TPC): broken schema integration
1 parent c607d72 commit ed115d8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

scripts/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ ${functionBody.join('\n')}
8585
scriptInput: {
8686
src: withQuery('${mainScript.url}', {${mainScript.params?.map(p => `${p}: options?.${p}`)}})
8787
},
88-
schema: import.meta.dev ? undefined : ${titleKey}Options,
88+
schema: import.meta.dev ? ${titleKey}Options : undefined,
8989
scriptOptions: {
9090
use: () => { return ${input.returnUse} },
9191
stub: import.meta.client ? undefined : ({fn}) => { return ${input.returnStub}},

src/runtime/registry/google-analytics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function useScriptGoogleAnalytics<T extends GoogleAnalyticsApi>(_options?
1919
scriptInput: {
2020
src: withQuery('https://www.googletagmanager.com/gtag/js', { id: options?.id }),
2121
},
22-
schema: import.meta.dev ? undefined : GoogleAnalyticsOptions,
22+
schema: import.meta.dev ? GoogleAnalyticsOptions : undefined,
2323
scriptOptions: {
2424
use: () => { return { dataLayer: window.dataLayers[options.dataLayerName!], gtag: window.gtag } },
2525
stub: import.meta.client ? undefined : ({ fn }) => { return fn === 'dataLayer' ? [] : void 0 },

src/runtime/registry/google-tag-manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ export type GoogleTagManagerInput = RegistryScriptInput<typeof GoogleTagManagerO
1515

1616
export function useScriptGoogleTagManager<T extends GoogleTagManagerApi>(_options?: GoogleTagManagerInput) {
1717
_options = defu(_options, { dataLayerName: 'defaultGtm' })
18-
return useRegistryScript<T, typeof GoogleTagManagerOptions>('googleTagManager', options => ({
18+
return useRegistryScript<T, typeof GoogleTagManagerOptions>(_options?.key || 'googleTagManager', options => ({
1919
scriptInput: {
2020
src: withQuery('https://www.googletagmanager.com/gtm.js', { id: options?.id }),
2121
},
22-
schema: import.meta.dev ? undefined : GoogleTagManagerOptions,
22+
schema: import.meta.dev ? GoogleTagManagerOptions : undefined,
2323
scriptOptions: {
2424
use: () => { return { dataLayer: window.dataLayers[options.dataLayerName!], google_tag_manager: window.google_tag_manager } },
2525
stub: import.meta.client ? undefined : ({ fn }) => { return fn === 'dataLayer' ? [] : void 0 },

0 commit comments

Comments
 (0)