File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
src/BootstrapBlazor/wwwroot/modules Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change 11import "./browser.js"
22import { execute } from "./ajax.js"
33
4- export async function ping ( url , invoke , method ) {
5- const data = await getClientInfo ( url ) ;
4+ export async function ping ( url , invoke , method , options ) {
5+ const data = await getClientInfo ( url , options ) ;
66 await invoke . invokeMethodAsync ( method , data )
77}
88
9- export async function getClientInfo ( url ) {
9+ export async function getClientInfo ( url , options ) {
1010 const info = browser ( )
1111 let data = {
1212 browser : info . browser + ' ' + info . version ,
@@ -17,12 +17,14 @@ export async function getClientInfo(url) {
1717 os : info . system + ' ' + info . systemVersion
1818 }
1919
20- const result = await execute ( {
21- method : 'GET' ,
22- url
23- } ) ;
24- if ( result ) {
25- data . ip = result . Ip ;
20+ if ( options . enableIpLocator === true ) {
21+ const result = await execute ( {
22+ method : 'GET' ,
23+ url
24+ } ) ;
25+ if ( result ) {
26+ data . ip = result . Ip ;
27+ }
2628 }
2729 data . id = localStorage . getItem ( 'bb_hub_connection_id' ) ?? result . Id ;
2830 return data ;
You can’t perform that action at this time.
0 commit comments