@100mslive/roomkit-react 0.3.15-alpha.2 → 0.3.15-alpha.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -4951,7 +4951,7 @@
4951
4951
  "format": "cjs"
4952
4952
  },
4953
4953
  "../hms-video-store/dist/index.js": {
4954
- "bytes": 356558,
4954
+ "bytes": 356613,
4955
4955
  "imports": [
4956
4956
  {
4957
4957
  "path": "../../node_modules/reselect/es/index.js",
@@ -10943,7 +10943,7 @@
10943
10943
  ],
10944
10944
  "format": "esm"
10945
10945
  },
10946
- "../../../../../../../tmp/tmp-2786-nYumfKEcA2YY/1906ec3fbfb3/tldraw.css": {
10946
+ "../../../../../../../tmp/tmp-2901-v3OIW4zyFLWA/19081d965e22/tldraw.css": {
10947
10947
  "bytes": 80111,
10948
10948
  "imports": [
10949
10949
  {
@@ -10993,7 +10993,7 @@
10993
10993
  }
10994
10994
  ]
10995
10995
  },
10996
- "../../../../../../../tmp/tmp-2786-nYumfKEcA2YY/1906ec3fb880/index.css": {
10996
+ "../../../../../../../tmp/tmp-2901-v3OIW4zyFLWA/19081d965890/index.css": {
10997
10997
  "bytes": 597,
10998
10998
  "imports": [
10999
10999
  {
@@ -11002,7 +11002,7 @@
11002
11002
  "external": true
11003
11003
  },
11004
11004
  {
11005
- "path": "../../../../../../../tmp/tmp-2786-nYumfKEcA2YY/1906ec3fbfb3/tldraw.css",
11005
+ "path": "../../../../../../../tmp/tmp-2901-v3OIW4zyFLWA/19081d965e22/tldraw.css",
11006
11006
  "kind": "import-rule",
11007
11007
  "original": "@tldraw/tldraw/tldraw.css"
11008
11008
  }
@@ -11077,7 +11077,7 @@
11077
11077
  "original": "../../common/constants"
11078
11078
  },
11079
11079
  {
11080
- "path": "../../../../../../../tmp/tmp-2786-nYumfKEcA2YY/1906ec3fb880/index.css",
11080
+ "path": "../../../../../../../tmp/tmp-2901-v3OIW4zyFLWA/19081d965890/index.css",
11081
11081
  "kind": "import-statement",
11082
11082
  "original": "@100mslive/hms-whiteboard/index.css"
11083
11083
  },
@@ -14099,8 +14099,8 @@
14099
14099
  ],
14100
14100
  "format": "esm"
14101
14101
  },
14102
- "src/Diagnostics/components.tsx": {
14103
- "bytes": 2724,
14102
+ "src/Diagnostics/DiagnosticsContext.ts": {
14103
+ "bytes": 1230,
14104
14104
  "imports": [
14105
14105
  {
14106
14106
  "path": "react",
@@ -14112,6 +14112,27 @@
14112
14112
  "kind": "import-statement",
14113
14113
  "external": true
14114
14114
  },
14115
+ {
14116
+ "path": "<define:process.env>",
14117
+ "kind": "import-statement",
14118
+ "external": true
14119
+ },
14120
+ {
14121
+ "path": "<runtime>",
14122
+ "kind": "import-statement",
14123
+ "external": true
14124
+ }
14125
+ ],
14126
+ "format": "esm"
14127
+ },
14128
+ "src/Diagnostics/components.tsx": {
14129
+ "bytes": 2075,
14130
+ "imports": [
14131
+ {
14132
+ "path": "react",
14133
+ "kind": "import-statement",
14134
+ "external": true
14135
+ },
14115
14136
  {
14116
14137
  "path": "src/Button/index.tsx",
14117
14138
  "kind": "import-statement",
@@ -14132,6 +14153,11 @@
14132
14153
  "kind": "import-statement",
14133
14154
  "external": true
14134
14155
  },
14156
+ {
14157
+ "path": "src/Diagnostics/DiagnosticsContext.ts",
14158
+ "kind": "import-statement",
14159
+ "original": "./DiagnosticsContext"
14160
+ },
14135
14161
  {
14136
14162
  "path": "<define:process.env>",
14137
14163
  "kind": "import-statement",
@@ -14362,7 +14388,7 @@
14362
14388
  "format": "esm"
14363
14389
  },
14364
14390
  "src/Diagnostics/AudioTest.tsx": {
14365
- "bytes": 5958,
14391
+ "bytes": 6167,
14366
14392
  "imports": [
14367
14393
  {
14368
14394
  "path": "react",
@@ -14414,6 +14440,11 @@
14414
14440
  "kind": "import-statement",
14415
14441
  "original": "./DeviceSelector"
14416
14442
  },
14443
+ {
14444
+ "path": "src/Diagnostics/DiagnosticsContext.ts",
14445
+ "kind": "import-statement",
14446
+ "original": "./DiagnosticsContext"
14447
+ },
14417
14448
  {
14418
14449
  "path": "src/Prebuilt/components/hooks/useAudioOutputTest.tsx",
14419
14450
  "kind": "import-statement",
@@ -14433,7 +14464,7 @@
14433
14464
  "format": "esm"
14434
14465
  },
14435
14466
  "src/Diagnostics/BrowserTest.tsx": {
14436
- "bytes": 4252,
14467
+ "bytes": 4366,
14437
14468
  "imports": [
14438
14469
  {
14439
14470
  "path": "react",
@@ -14460,6 +14491,11 @@
14460
14491
  "kind": "import-statement",
14461
14492
  "original": "../Text"
14462
14493
  },
14494
+ {
14495
+ "path": "src/Diagnostics/DiagnosticsContext.ts",
14496
+ "kind": "import-statement",
14497
+ "original": "./DiagnosticsContext"
14498
+ },
14463
14499
  {
14464
14500
  "path": "<define:process.env>",
14465
14501
  "kind": "import-statement",
@@ -14469,7 +14505,7 @@
14469
14505
  "format": "esm"
14470
14506
  },
14471
14507
  "src/Diagnostics/ConnectivityTest.tsx": {
14472
- "bytes": 11975,
14508
+ "bytes": 12150,
14473
14509
  "imports": [
14474
14510
  {
14475
14511
  "path": "react",
@@ -14516,6 +14552,11 @@
14516
14552
  "kind": "import-statement",
14517
14553
  "original": "../Text"
14518
14554
  },
14555
+ {
14556
+ "path": "src/Diagnostics/DiagnosticsContext.ts",
14557
+ "kind": "import-statement",
14558
+ "original": "./DiagnosticsContext"
14559
+ },
14519
14560
  {
14520
14561
  "path": "<define:process.env>",
14521
14562
  "kind": "import-statement",
@@ -14525,7 +14566,7 @@
14525
14566
  "format": "esm"
14526
14567
  },
14527
14568
  "src/Diagnostics/VideoTest.tsx": {
14528
- "bytes": 2591,
14569
+ "bytes": 2718,
14529
14570
  "imports": [
14530
14571
  {
14531
14572
  "path": "react",
@@ -14577,6 +14618,11 @@
14577
14618
  "kind": "import-statement",
14578
14619
  "original": "./DeviceSelector"
14579
14620
  },
14621
+ {
14622
+ "path": "src/Diagnostics/DiagnosticsContext.ts",
14623
+ "kind": "import-statement",
14624
+ "original": "./DiagnosticsContext"
14625
+ },
14580
14626
  {
14581
14627
  "path": "<define:process.env>",
14582
14628
  "kind": "import-statement",
@@ -14591,7 +14637,7 @@
14591
14637
  "format": "esm"
14592
14638
  },
14593
14639
  "src/Diagnostics/Diagnostics.tsx": {
14594
- "bytes": 5171,
14640
+ "bytes": 5845,
14595
14641
  "imports": [
14596
14642
  {
14597
14643
  "path": "react",
@@ -14608,11 +14654,6 @@
14608
14654
  "kind": "import-statement",
14609
14655
  "external": true
14610
14656
  },
14611
- {
14612
- "path": "src/Diagnostics/components.tsx",
14613
- "kind": "import-statement",
14614
- "original": "./components"
14615
- },
14616
14657
  {
14617
14658
  "path": "src/Layout/index.tsx",
14618
14659
  "kind": "import-statement",
@@ -14643,6 +14684,11 @@
14643
14684
  "kind": "import-statement",
14644
14685
  "original": "./ConnectivityTest"
14645
14686
  },
14687
+ {
14688
+ "path": "src/Diagnostics/DiagnosticsContext.ts",
14689
+ "kind": "import-statement",
14690
+ "original": "./DiagnosticsContext"
14691
+ },
14646
14692
  {
14647
14693
  "path": "src/Diagnostics/VideoTest.tsx",
14648
14694
  "kind": "import-statement",
@@ -14652,6 +14698,11 @@
14652
14698
  "path": "<define:process.env>",
14653
14699
  "kind": "import-statement",
14654
14700
  "external": true
14701
+ },
14702
+ {
14703
+ "path": "<runtime>",
14704
+ "kind": "import-statement",
14705
+ "external": true
14655
14706
  }
14656
14707
  ],
14657
14708
  "format": "esm"
@@ -14899,7 +14950,7 @@
14899
14950
  "dist/index.js": {
14900
14951
  "imports": [
14901
14952
  {
14902
- "path": "dist/chunk-25Y7QR25.js",
14953
+ "path": "dist/chunk-3RS665CV.js",
14903
14954
  "kind": "import-statement"
14904
14955
  }
14905
14956
  ],
@@ -14975,16 +15026,16 @@
14975
15026
  "inputs": {},
14976
15027
  "bytes": 1882
14977
15028
  },
14978
- "dist/HLSView-IBBAZRGB.js.map": {
15029
+ "dist/HLSView-HMRFCBTS.js.map": {
14979
15030
  "imports": [],
14980
15031
  "exports": [],
14981
15032
  "inputs": {},
14982
15033
  "bytes": 100275
14983
15034
  },
14984
- "dist/HLSView-IBBAZRGB.js": {
15035
+ "dist/HLSView-HMRFCBTS.js": {
14985
15036
  "imports": [
14986
15037
  {
14987
- "path": "dist/chunk-25Y7QR25.js",
15038
+ "path": "dist/chunk-3RS665CV.js",
14988
15039
  "kind": "import-statement"
14989
15040
  },
14990
15041
  {
@@ -15162,7 +15213,7 @@
15162
15213
  "default"
15163
15214
  ],
15164
15215
  "entryPoint": "src/Prebuilt/layouts/HLSView.jsx",
15165
- "cssBundle": "dist/HLSView-PFCSCJTH.css",
15216
+ "cssBundle": "dist/HLSView-UZREPPDA.css",
15166
15217
  "inputs": {
15167
15218
  "src/Prebuilt/layouts/HLSView.jsx": {
15168
15219
  "bytesInOutput": 27671
@@ -15221,13 +15272,13 @@
15221
15272
  },
15222
15273
  "bytes": 61702
15223
15274
  },
15224
- "dist/chunk-25Y7QR25.js.map": {
15275
+ "dist/chunk-3RS665CV.js.map": {
15225
15276
  "imports": [],
15226
15277
  "exports": [],
15227
15278
  "inputs": {},
15228
- "bytes": 3439867
15279
+ "bytes": 3442935
15229
15280
  },
15230
- "dist/chunk-25Y7QR25.js": {
15281
+ "dist/chunk-3RS665CV.js": {
15231
15282
  "imports": [
15232
15283
  {
15233
15284
  "path": "react",
@@ -17700,7 +17751,7 @@
17700
17751
  "external": true
17701
17752
  },
17702
17753
  {
17703
- "path": "dist/HLSView-IBBAZRGB.js",
17754
+ "path": "dist/HLSView-HMRFCBTS.js",
17704
17755
  "kind": "dynamic-import"
17705
17756
  },
17706
17757
  {
@@ -18129,17 +18180,22 @@
18129
18180
  "external": true
18130
18181
  },
18131
18182
  {
18132
- "path": "react",
18183
+ "path": "@100mslive/react-sdk",
18133
18184
  "kind": "import-statement",
18134
18185
  "external": true
18135
18186
  },
18136
18187
  {
18137
- "path": "@100mslive/react-sdk",
18188
+ "path": "@100mslive/react-icons",
18138
18189
  "kind": "import-statement",
18139
18190
  "external": true
18140
18191
  },
18141
18192
  {
18142
- "path": "@100mslive/react-icons",
18193
+ "path": "react",
18194
+ "kind": "import-statement",
18195
+ "external": true
18196
+ },
18197
+ {
18198
+ "path": "react",
18143
18199
  "kind": "import-statement",
18144
18200
  "external": true
18145
18201
  },
@@ -18284,7 +18340,7 @@
18284
18340
  ],
18285
18341
  "inputs": {
18286
18342
  "<define:process.env>": {
18287
- "bytesInOutput": 17912
18343
+ "bytesInOutput": 17940
18288
18344
  },
18289
18345
  "../../node_modules/lodash/lodash.js": {
18290
18346
  "bytesInOutput": 224289
@@ -19153,7 +19209,7 @@
19153
19209
  "src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx": {
19154
19210
  "bytesInOutput": 2830
19155
19211
  },
19156
- "../../../../../../../tmp/tmp-2786-nYumfKEcA2YY/1906ec3fb880/index.css": {
19212
+ "../../../../../../../tmp/tmp-2901-v3OIW4zyFLWA/19081d965890/index.css": {
19157
19213
  "bytesInOutput": 0
19158
19214
  },
19159
19215
  "src/Prebuilt/common/PeersSorter.ts": {
@@ -19298,28 +19354,31 @@
19298
19354
  "bytesInOutput": 27
19299
19355
  },
19300
19356
  "src/Diagnostics/Diagnostics.tsx": {
19301
- "bytesInOutput": 5593
19357
+ "bytesInOutput": 6183
19358
+ },
19359
+ "src/Diagnostics/AudioTest.tsx": {
19360
+ "bytesInOutput": 6444
19302
19361
  },
19303
19362
  "src/Diagnostics/components.tsx": {
19304
- "bytesInOutput": 2444
19363
+ "bytesInOutput": 2027
19305
19364
  },
19306
- "src/Diagnostics/AudioTest.tsx": {
19307
- "bytesInOutput": 6270
19365
+ "src/Diagnostics/DiagnosticsContext.ts": {
19366
+ "bytesInOutput": 1076
19308
19367
  },
19309
19368
  "src/Diagnostics/DeviceSelector.jsx": {
19310
19369
  "bytesInOutput": 2155
19311
19370
  },
19312
19371
  "src/Diagnostics/BrowserTest.tsx": {
19313
- "bytesInOutput": 4380
19372
+ "bytesInOutput": 4418
19314
19373
  },
19315
19374
  "src/Diagnostics/ConnectivityTest.tsx": {
19316
- "bytesInOutput": 13489
19375
+ "bytesInOutput": 13570
19317
19376
  },
19318
19377
  "src/Diagnostics/VideoTest.tsx": {
19319
- "bytesInOutput": 2577
19378
+ "bytesInOutput": 2628
19320
19379
  }
19321
19380
  },
19322
- "bytes": 1424074
19381
+ "bytes": 1425772
19323
19382
  },
19324
19383
  "dist/index.css.map": {
19325
19384
  "imports": [],
@@ -19381,22 +19440,22 @@
19381
19440
  }
19382
19441
  ],
19383
19442
  "inputs": {
19384
- "../../../../../../../tmp/tmp-2786-nYumfKEcA2YY/1906ec3fbfb3/tldraw.css": {
19443
+ "../../../../../../../tmp/tmp-2901-v3OIW4zyFLWA/19081d965e22/tldraw.css": {
19385
19444
  "bytesInOutput": 75223
19386
19445
  },
19387
- "../../../../../../../tmp/tmp-2786-nYumfKEcA2YY/1906ec3fb880/index.css": {
19446
+ "../../../../../../../tmp/tmp-2901-v3OIW4zyFLWA/19081d965890/index.css": {
19388
19447
  "bytesInOutput": 401
19389
19448
  }
19390
19449
  },
19391
19450
  "bytes": 75901
19392
19451
  },
19393
- "dist/HLSView-PFCSCJTH.css.map": {
19452
+ "dist/HLSView-UZREPPDA.css.map": {
19394
19453
  "imports": [],
19395
19454
  "exports": [],
19396
19455
  "inputs": {},
19397
19456
  "bytes": 122402
19398
19457
  },
19399
- "dist/HLSView-PFCSCJTH.css": {
19458
+ "dist/HLSView-UZREPPDA.css": {
19400
19459
  "imports": [
19401
19460
  {
19402
19461
  "path": "https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap",
@@ -19450,10 +19509,10 @@
19450
19509
  }
19451
19510
  ],
19452
19511
  "inputs": {
19453
- "../../../../../../../tmp/tmp-2786-nYumfKEcA2YY/1906ec3fbfb3/tldraw.css": {
19512
+ "../../../../../../../tmp/tmp-2901-v3OIW4zyFLWA/19081d965e22/tldraw.css": {
19454
19513
  "bytesInOutput": 75223
19455
19514
  },
19456
- "../../../../../../../tmp/tmp-2786-nYumfKEcA2YY/1906ec3fb880/index.css": {
19515
+ "../../../../../../../tmp/tmp-2901-v3OIW4zyFLWA/19081d965890/index.css": {
19457
19516
  "bytesInOutput": 401
19458
19517
  }
19459
19518
  },
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "prebuilt",
11
11
  "roomkit"
12
12
  ],
13
- "version": "0.3.15-alpha.2",
13
+ "version": "0.3.15-alpha.4",
14
14
  "author": "100ms",
15
15
  "license": "MIT",
16
16
  "repository": {
@@ -75,12 +75,12 @@
75
75
  "react": ">=17.0.2 <19.0.0"
76
76
  },
77
77
  "dependencies": {
78
- "@100mslive/hls-player": "0.3.15-alpha.2",
78
+ "@100mslive/hls-player": "0.3.15-alpha.4",
79
79
  "@100mslive/hms-noise-cancellation": "0.0.1",
80
- "@100mslive/hms-virtual-background": "1.13.15-alpha.2",
81
- "@100mslive/hms-whiteboard": "0.0.5-alpha.2",
82
- "@100mslive/react-icons": "0.10.15-alpha.2",
83
- "@100mslive/react-sdk": "0.10.15-alpha.2",
80
+ "@100mslive/hms-virtual-background": "1.13.15-alpha.4",
81
+ "@100mslive/hms-whiteboard": "0.0.5-alpha.4",
82
+ "@100mslive/react-icons": "0.10.15-alpha.4",
83
+ "@100mslive/react-sdk": "0.10.15-alpha.4",
84
84
  "@100mslive/types-prebuilt": "0.12.9",
85
85
  "@emoji-mart/data": "^1.0.6",
86
86
  "@emoji-mart/react": "^1.0.1",
@@ -116,5 +116,5 @@
116
116
  "uuid": "^8.3.2",
117
117
  "worker-timers": "^7.0.40"
118
118
  },
119
- "gitHead": "da2cd3ce25b00c03fd1305ff2f151fcb5e0840e8"
119
+ "gitHead": "f7dd781ff1065f5b13e42d24f63b7ae74c2dac6b"
120
120
  }
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable react/prop-types */
2
- import React, { useContext, useEffect, useState } from 'react';
2
+ import React, { useCallback, useEffect, useState } from 'react';
3
3
  import {
4
4
  HMSException,
5
5
  selectDevices,
@@ -11,13 +11,14 @@ import {
11
11
  } from '@100mslive/react-sdk';
12
12
  import { MicOnIcon, SpeakerIcon, StopIcon } from '@100mslive/react-icons';
13
13
  import { PermissionErrorModal } from '../Prebuilt/components/Notifications/PermissionErrorModal';
14
- import { DiagnosticsContext, TestContainer, TestFooter } from './components';
14
+ import { TestContainer, TestFooter } from './components';
15
15
  import { Button } from '../Button';
16
16
  import { Box, Flex } from '../Layout';
17
17
  import { Progress } from '../Progress';
18
18
  import { Text } from '../Text';
19
19
  // @ts-ignore: No implicit any
20
20
  import { DeviceSelector } from './DeviceSelector';
21
+ import { DiagnosticsStep, useDiagnostics } from './DiagnosticsContext';
21
22
  import { useAudioOutputTest } from '../Prebuilt/components/hooks/useAudioOutputTest';
22
23
  import { TEST_AUDIO_URL } from '../Prebuilt/common/constants';
23
24
 
@@ -25,8 +26,8 @@ const SelectContainer = ({ children }: { children: React.ReactNode }) => (
25
26
  <Box css={{ w: 'calc(50% - 0.75rem)', '@lg': { w: '100%' } }}>{children}</Box>
26
27
  );
27
28
 
28
- const MicTest = ({ setError }: { setError: React.Dispatch<React.SetStateAction<Error | undefined>> }) => {
29
- const { hmsDiagnostics } = useContext(DiagnosticsContext);
29
+ const MicTest = ({ setError }: { setError: (err?: Error) => void }) => {
30
+ const { hmsDiagnostics } = useDiagnostics();
30
31
  const devices = useHMSStore(selectDevices);
31
32
  const [isRecording, setIsRecording] = useState(false);
32
33
  const [selectedMic, setSelectedMic] = useState(devices.audioInput[0]?.deviceId || 'default');
@@ -142,11 +143,20 @@ const SpeakerTest = () => {
142
143
  };
143
144
 
144
145
  export const AudioTest = () => {
145
- const { hmsDiagnostics } = useContext(DiagnosticsContext);
146
- const [error, setError] = useState<Error | undefined>();
146
+ const { hmsDiagnostics, updateStep } = useDiagnostics();
147
+ const [error, setErrorAlone] = useState<Error | undefined>();
148
+
149
+ const setError = useCallback(
150
+ (err?: Error) => {
151
+ updateStep(DiagnosticsStep.AUDIO, { hasFailed: !!err });
152
+ setErrorAlone(err);
153
+ },
154
+ [updateStep, setErrorAlone],
155
+ );
156
+
147
157
  useEffect(() => {
148
158
  hmsDiagnostics?.requestPermission({ audio: true }).catch(error => setError(error));
149
- }, [hmsDiagnostics]);
159
+ }, [hmsDiagnostics, setError]);
150
160
 
151
161
  return (
152
162
  <>
@@ -1,8 +1,9 @@
1
- import React, { useContext, useEffect, useState } from 'react';
1
+ import React, { useEffect, useState } from 'react';
2
2
  import { parsedUserAgent } from '@100mslive/react-sdk';
3
- import { DiagnosticsContext, TestContainer, TestFooter } from './components';
3
+ import { TestContainer, TestFooter } from './components';
4
4
  import { Box, Flex } from '../Layout';
5
5
  import { Text } from '../Text';
6
+ import { DiagnosticsStep, useDiagnostics } from './DiagnosticsContext';
6
7
 
7
8
  const CMS_MEDIA_SERVER = 'https://storage.googleapis.com/100ms-cms-prod/';
8
9
 
@@ -102,15 +103,16 @@ const CheckDetails = ({ title, value, iconURL }: { title: string; value: string;
102
103
  );
103
104
 
104
105
  export const BrowserTest = () => {
105
- const { hmsDiagnostics } = useContext(DiagnosticsContext);
106
+ const { hmsDiagnostics, updateStep } = useDiagnostics();
106
107
  const [error, setError] = useState<Error | undefined>();
107
108
  useEffect(() => {
108
109
  try {
109
110
  hmsDiagnostics?.checkBrowserSupport();
110
111
  } catch (err) {
112
+ updateStep(DiagnosticsStep.BROWSER, { hasFailed: true });
111
113
  setError(err as Error);
112
114
  }
113
- }, [hmsDiagnostics]);
115
+ }, [hmsDiagnostics, updateStep]);
114
116
  return (
115
117
  <>
116
118
  <TestContainer css={{ display: 'flex', gap: '$8', '@lg': { display: 'block' } }}>
@@ -1,12 +1,13 @@
1
- import React, { useContext, useState } from 'react';
1
+ import React, { useState } from 'react';
2
2
  import { ConnectivityCheckResult, ConnectivityState, DiagnosticsRTCStats } from '@100mslive/react-sdk';
3
3
  import { CheckCircleIcon, CrossCircleIcon, EyeCloseIcon, EyeOpenIcon, LinkIcon } from '@100mslive/react-icons';
4
- import { DiagnosticsContext, TestContainer, TestFooter } from './components';
4
+ import { TestContainer, TestFooter } from './components';
5
5
  import { Button } from '../Button';
6
6
  import { Box, Flex } from '../Layout';
7
7
  import { Loading } from '../Loading';
8
8
  import { formatBytes } from '../Stats';
9
9
  import { Text } from '../Text';
10
+ import { DiagnosticsStep, useDiagnostics } from './DiagnosticsContext';
10
11
 
11
12
  const Regions = {
12
13
  in: 'India',
@@ -35,7 +36,7 @@ export const ConnectivityTestStepResult = ({
35
36
  success?: boolean;
36
37
  children: React.ReactNode;
37
38
  }) => {
38
- const [hideDetails, setHideDetails] = useState(false);
39
+ const [hideDetails, setHideDetails] = useState(true);
39
40
 
40
41
  return (
41
42
  <Box css={{ my: '$10', p: '$10', r: '$1', bg: '$surface_bright' }}>
@@ -331,14 +332,14 @@ const RegionSelector = ({
331
332
  };
332
333
 
333
334
  export const ConnectivityTest = () => {
334
- const { hmsDiagnostics, setConnectivityTested } = useContext(DiagnosticsContext);
335
+ const { hmsDiagnostics, updateStep } = useDiagnostics();
335
336
  const [region, setRegion] = useState<string | undefined>(Object.keys(Regions)[0]);
336
337
  const [error, setError] = useState<Error | undefined>();
337
338
  const [progress, setProgress] = useState<ConnectivityState>();
338
339
  const [result, setResult] = useState<ConnectivityCheckResult | undefined>();
339
340
 
340
341
  const startTest = () => {
341
- setConnectivityTested(false);
342
+ updateStep(DiagnosticsStep.CONNECTIVITY, { hasFailed: false, isCompleted: false });
342
343
  setError(undefined);
343
344
  setResult(undefined);
344
345
  hmsDiagnostics
@@ -347,12 +348,13 @@ export const ConnectivityTest = () => {
347
348
  setProgress(state);
348
349
  },
349
350
  result => {
350
- setConnectivityTested(true);
351
+ updateStep(DiagnosticsStep.CONNECTIVITY, { isCompleted: true });
351
352
  setResult(result);
352
353
  },
353
354
  region,
354
355
  )
355
356
  .catch(error => {
357
+ updateStep(DiagnosticsStep.CONNECTIVITY, { hasFailed: true });
356
358
  setError(error);
357
359
  });
358
360
  };