File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { IonToggle } from '@ionic/react' ;
22import type { FC } from 'react' ;
33
4+ import { maskValue } from '../../utils/maskValue' ;
45import SectionCard from '../SectionCard' ;
56
67interface AppSectionProps {
@@ -23,7 +24,7 @@ const AppSection: FC<AppSectionProps> = ({
2324 < div className = "kv-row" >
2425 < span > App ID</ span >
2526 < span className = "id-value" data-testid = "app_id_value" >
26- { appId }
27+ { maskValue ( appId ) }
2728 </ span >
2829 </ div >
2930 </ div >
Original file line number Diff line number Diff line change 11import { IonToggle } from '@ionic/react' ;
22import type { FC } from 'react' ;
33
4+ import { maskValue } from '../../utils/maskValue' ;
45import ActionButton from '../ActionButton' ;
56import SectionCard from '../SectionCard' ;
67
@@ -26,7 +27,7 @@ const PushSection: FC<PushSectionProps> = ({
2627 < div className = "kv-row" >
2728 < span > Push ID</ span >
2829 < span className = "id-value" data-testid = "push_id_value" >
29- { pushSubscriptionId ?? '—' }
30+ { maskValue ( pushSubscriptionId ?? '—' ) }
3031 </ span >
3132 </ div >
3233 < div className = "divider" />
Original file line number Diff line number Diff line change 1+ // Mirrors the trim/strict-equals check used elsewhere so a stray newline
2+ // or whitespace in `.env` doesn't accidentally enable masking.
3+ const E2E_MODE = ( import . meta. env . VITE_E2E_MODE ?? '' ) . trim ( ) === 'true' ;
4+ const MASK_CHAR = '•' ;
5+
6+ export function maskValue ( value : string ) : string {
7+ if ( E2E_MODE ) {
8+ return MASK_CHAR . repeat ( value . length ) ;
9+ }
10+ return value ;
11+ }
Original file line number Diff line number Diff line change 1+ VITE_ONESIGNAL_APP_ID = your_onesignal_app_id
12VITE_ONESIGNAL_API_KEY = your_rest_api_key
3+ VITE_E2E_MODE = false
Original file line number Diff line number Diff line change 11import { IonToggle } from '@ionic/react' ;
22import type { FC } from 'react' ;
33
4+ import { maskValue } from '../../utils/maskValue' ;
45import SectionCard from '../SectionCard' ;
56
67interface AppSectionProps {
@@ -23,7 +24,7 @@ const AppSection: FC<AppSectionProps> = ({
2324 < div className = "kv-row" >
2425 < span > App ID</ span >
2526 < span className = "id-value" data-testid = "app_id_value" >
26- { appId }
27+ { maskValue ( appId ) }
2728 </ span >
2829 </ div >
2930 </ div >
Original file line number Diff line number Diff line change 11import { IonToggle } from '@ionic/react' ;
22import type { FC } from 'react' ;
33
4+ import { maskValue } from '../../utils/maskValue' ;
45import ActionButton from '../ActionButton' ;
56import SectionCard from '../SectionCard' ;
67
@@ -26,7 +27,7 @@ const PushSection: FC<PushSectionProps> = ({
2627 < div className = "kv-row" >
2728 < span > Push ID</ span >
2829 < span className = "id-value" data-testid = "push_id_value" >
29- { pushSubscriptionId ?? '—' }
30+ { maskValue ( pushSubscriptionId ?? '—' ) }
3031 </ span >
3132 </ div >
3233 < div className = "divider" />
Original file line number Diff line number Diff line change 1+ // Mirrors the trim/strict-equals check used elsewhere so a stray newline
2+ // or whitespace in `.env` doesn't accidentally enable masking.
3+ const E2E_MODE = ( import . meta. env . VITE_E2E_MODE ?? '' ) . trim ( ) === 'true' ;
4+ const MASK_CHAR = '•' ;
5+
6+ export function maskValue ( value : string ) : string {
7+ if ( E2E_MODE ) {
8+ return MASK_CHAR . repeat ( value . length ) ;
9+ }
10+ return value ;
11+ }
You can’t perform that action at this time.
0 commit comments