Skip to content

Commit 8cfa9ba

Browse files
committed
wip
1 parent af7d0f5 commit 8cfa9ba

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

packages/signals/signals/src/core/signals/settings.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,14 @@ export class SignalsDebugSettings {
137137
}
138138

139139
getDisableSignalsRedaction = (): boolean => {
140-
return this.storage.getItem(SignalsDebugSettings.redactionKey) ?? false
140+
return (
141+
this.storage.getBooleanItem(SignalsDebugSettings.redactionKey) ?? false
142+
)
141143
}
142144

143145
getEnableSignalsIngestion = (): boolean => {
144-
return this.storage.getItem(SignalsDebugSettings.ingestionKey) ?? false
146+
return (
147+
this.storage.getBooleanItem(SignalsDebugSettings.ingestionKey) ?? false
148+
)
145149
}
146150
}

packages/signals/signals/src/lib/storage/web-storage.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,17 @@ export class WebStorage {
1212
}
1313
}
1414

15-
public getItem = <T>(key: string): T | undefined => {
15+
public getItem = (key: string): string | undefined => {
1616
try {
17-
return (this.storage.getItem(key) as T) ?? undefined
17+
return this.storage.getItem(key) ?? undefined
1818
} catch (e) {
1919
console.warn('Storage error', e)
2020
}
2121
return undefined
2222
}
23+
24+
public getBooleanItem = (key: string): boolean | undefined => {
25+
const item = this.getItem(key)
26+
return item === 'true' ? true : item === 'false' ? false : undefined
27+
}
2328
}

0 commit comments

Comments
 (0)