Add gtag to history

This commit is contained in:
Steve Ruiz 2021-06-19 17:24:51 +01:00
parent fd85e07728
commit 6711f980d8

View file

@ -1,4 +1,5 @@
import { Data } from 'types' import { Data } from 'types'
import * as gtag from 'utils/gtag'
import { BaseCommand } from './commands/command' import { BaseCommand } from './commands/command'
import storage from './storage' import storage from './storage'
@ -11,6 +12,13 @@ class History<T extends Data> {
private _enabled = true private _enabled = true
execute = (data: T, command: BaseCommand<T>) => { execute = (data: T, command: BaseCommand<T>) => {
gtag.event({
action: command.name,
category: command.category,
label: '',
value: 0,
})
command.redo(data, true) command.redo(data, true)
if (this.disabled) return if (this.disabled) return