Skip to content

Commit

Permalink
misc: update checkConnectionFunc (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
embbnux authored Jul 31, 2024
1 parent 32a7faf commit 826b5dc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/modules/Phone/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,23 @@ import { GenericPhone } from './interface';
StorageProvider: LocalForageStorage,
} as GlobalStorageOptions,
},
{
provide: 'ConnectivityMonitorOptions',
useValue: {
checkConnectionFunc: async () => {
const response = await fetch(
'https://apps.ringcentral.com/integrations/ping',
{
method: 'HEAD',
mode: 'no-cors',
},
);
if (response.type !== 'opaque' && response.status !== 200) {
throw new Error('Network check failed');
}
},
},
},
{ provide: 'ContactMatcher', useClass: ContactMatcher },
{ provide: 'ActivityMatcher', useClass: ActivityMatcher },
{ provide: 'Presence', useClass: EvPresence },
Expand Down

0 comments on commit 826b5dc

Please sign in to comment.