Skip to content

Commit

Permalink
fix: 🐛 revert
Browse files Browse the repository at this point in the history
  • Loading branch information
MooseSaeed committed Jun 7, 2023
1 parent 735a164 commit fb06cc7
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,7 @@ export default function (ctx, inject) {
const id = '<%= options.id %>'
const runtimeId = runtimeConfig.id
const initialized = autoInit && id ? {[id]: true} : {}

let $gtm
if(process.client) {
window.onNuxtReady(() => {
$gtm = gtmClient(ctx, initialized)
})
} else {
$gtm = gtmServer(ctx, initialized)
}
const $gtm = process.client ? gtmClient(ctx, initialized) : gtmServer(ctx, initialized)
if (autoInit && runtimeId && runtimeId !== id) {
$gtm.init(runtimeId)
}
Expand Down

0 comments on commit fb06cc7

Please sign in to comment.