Skip to content

Commit f7d59fa

Browse files
committed
wip
1 parent 65ebf38 commit f7d59fa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/signals/signals/src/plugin/signals-plugin.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { AnyAnalytics, SignalsPluginSettingsConfig } from '../types'
55
import { Signal } from '@segment/analytics-signals-runtime'
66
import { assertBrowserEnv } from '../lib/assert-browser-env'
77
import { version } from '../generated/version'
8+
import { getPageData } from '../lib/page-data'
89

910
export type OnSignalCb = (signal: Signal) => void
1011

@@ -83,7 +84,10 @@ export class SignalsPlugin implements Plugin, SignalsAugmentedFunctionality {
8384
}
8485

8586
addSignal(signal: Signal): this {
86-
this.signals.signalEmitter.emit(signal)
87+
signal.data.page ??= getPageData()
88+
this.signals.signalEmitter.emit({
89+
...signal,
90+
})
8791
return this
8892
}
8993

0 commit comments

Comments
 (0)