File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import type {
1111} from '@sirenapp/js-sdk/dist/esm/types' ;
1212
1313import type { SirenProviderConfigProps } from '../types' ;
14- import { isNonEmptyArray , logger } from '../utils/commonUtils' ;
14+ import { generateUniqueId , isNonEmptyArray , logger } from '../utils/commonUtils' ;
1515import {
1616 events ,
1717 eventTypes ,
@@ -76,10 +76,6 @@ export const useSirenContext = (): SirenContextProp => useContext(SirenContext);
7676const SirenProvider : React . FC < SirenProvider > = ( { config, children } ) => {
7777 let retryCount = 0 ;
7878
79- const generateUniqueId = ( ) : string => {
80- return Math . random ( ) . toString ( 36 ) . substring ( 2 , 15 ) ;
81- } ;
82-
8379 const { markAllAsViewed } = useSiren ( ) ;
8480
8581 const [ id ] = useState ( generateUniqueId ( ) ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ import { DefaultTheme } from './index';
88export const isNonEmptyArray = ( arr ?: unknown [ ] | null ) =>
99 Boolean ( arr && typeof arr === 'object' && arr instanceof Array && arr . length > 0 ) ;
1010
11+ export const generateUniqueId = ( ) : string => {
12+ return Math . random ( ) . toString ( 36 ) . substring ( 2 , 15 ) ;
13+ } ;
14+
1115export const updateNotifications = (
1216 eventData : {
1317 id ?: string ;
You can’t perform that action at this time.
0 commit comments