Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Commit d85f6b4

Browse files
fix: window is not defined for
closes #120
1 parent 7d08674 commit d85f6b4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import analyticsMiddleware from './vuex-middleware'
99
export default function install (Vue, options = {}) {
1010
update({ ...options, $vue: Vue })
1111

12-
if (window && !window.ga) {
12+
if (typeof window !== 'undefined' && !window.ga) {
1313
window.ga = window.ga || function () {
1414
(window.ga.q = window.ga.q || []).push(arguments)
1515
}

src/no-ga.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getId } from './config'
22

33
export default () => {
4-
if (!window) {
4+
if (typeof window === 'undefined') {
55
return
66
}
77

0 commit comments

Comments
 (0)