@@ -5,7 +5,7 @@ import { SignalsIngestSettingsConfig } from '../client'
55import { SandboxSettingsConfig } from '../processor/sandbox'
66import { NetworkSettingsConfig } from '../signal-generators/network-gen'
77import { SignalsPluginSettingsConfig } from '../../types'
8- import { DebugStorage } from '../../lib/storage/debug -storage'
8+ import { WebStorage } from '../../lib/storage/web -storage'
99
1010export type SignalsSettingsConfig = Pick <
1111 SignalsPluginSettingsConfig ,
@@ -114,22 +114,14 @@ export class SignalGlobalSettings {
114114export class SignalsDebugSettings {
115115 private static redactionKey = 'segment_signals_debug_redaction_disabled'
116116 private static ingestionKey = 'segment_signals_debug_ingestion_enabled'
117- private static logSignals = 'segment_signals_log_signals_enabled'
118- storage : DebugStorage
117+ private storage = new WebStorage ( window . sessionStorage )
119118
120119 constructor ( disableRedaction ?: boolean , enableIngestion ?: boolean ) {
121- this . storage = new DebugStorage ( 'sessionStorage' )
122120 if ( typeof disableRedaction === 'boolean' ) {
123- this . storage . setDebugKey (
124- SignalsDebugSettings . redactionKey ,
125- disableRedaction
126- )
121+ this . storage . setItem ( SignalsDebugSettings . redactionKey , disableRedaction )
127122 }
128123 if ( typeof enableIngestion === 'boolean' ) {
129- this . storage . setDebugKey (
130- SignalsDebugSettings . ingestionKey ,
131- enableIngestion
132- )
124+ this . storage . setItem ( SignalsDebugSettings . ingestionKey , enableIngestion )
133125 }
134126
135127 const debugModeInQs = parseDebugModeQueryString ( )
@@ -140,20 +132,19 @@ export class SignalsDebugSettings {
140132 }
141133
142134 setAllDebugging = ( boolean : boolean ) => {
143- this . storage . setDebugKey ( SignalsDebugSettings . redactionKey , boolean )
144- this . storage . setDebugKey ( SignalsDebugSettings . ingestionKey , boolean )
145- this . storage . setDebugKey ( SignalsDebugSettings . logSignals , boolean )
135+ this . storage . setItem ( SignalsDebugSettings . redactionKey , boolean )
136+ this . storage . setItem ( SignalsDebugSettings . ingestionKey , boolean )
146137 }
147138
148139 getDisableSignalsRedaction = ( ) : boolean => {
149- return this . storage . getDebugKey ( SignalsDebugSettings . redactionKey )
140+ return (
141+ this . storage . getItem < boolean > ( SignalsDebugSettings . redactionKey ) ?? false
142+ )
150143 }
151144
152145 getEnableSignalsIngestion = ( ) : boolean => {
153- return this . storage . getDebugKey ( SignalsDebugSettings . ingestionKey )
154- }
155-
156- getEnableLogSignals = ( ) : boolean => {
157- return this . storage . getDebugKey ( SignalsDebugSettings . logSignals )
146+ return (
147+ this . storage . getItem < boolean > ( SignalsDebugSettings . ingestionKey ) ?? false
148+ )
158149 }
159150}
0 commit comments