File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,15 +63,15 @@ export const getServicesBaseInfo = (): ServiceInfo[] =>
6363 * const myService = services.find((service) => service.id === 'my-service-id')
6464 */
6565export const getServicesFromLocalStorage = ( ) : ServiceInfoFromLocalStorage [ ] => {
66- const ucSettings = IS_BROWSER && localStorage ?. getItem ( 'uc_settings' )
67- if ( ucSettings ) {
68- try {
66+ try {
67+ const ucSettings = IS_BROWSER && localStorage ?. getItem ( 'uc_settings' )
68+ if ( ucSettings ) {
6969 const ucSettingsObj = JSON . parse ( ucSettings ) as SettingsFromLocalStorage
7070 /** Leave out any other untyped fields */
7171 return ucSettingsObj . services . map ( ( { id, status } ) => ( { id, status } ) )
72- } catch {
73- /** Ignore failures */
7472 }
73+ } catch {
74+ /** Ignore failures */
7575 }
7676
7777 return [ ]
@@ -87,8 +87,12 @@ export const getServicesFromLocalStorage = (): ServiceInfoFromLocalStorage[] =>
8787 * }
8888 */
8989export const hasUserInteracted = ( ) : boolean => {
90- const userInteraction = IS_BROWSER && localStorage ?. getItem ( 'uc_user_interaction' )
91- return userInteraction === 'true'
90+ try {
91+ const userInteraction = IS_BROWSER && localStorage ?. getItem ( 'uc_user_interaction' )
92+ return userInteraction === 'true'
93+ } catch {
94+ return false
95+ }
9296}
9397
9498/**
You can’t perform that action at this time.
0 commit comments