mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov-ui.git
synced 2025-10-29 17:52:25 +00:00
[WIFI-11119] Fix crash on empty analytics point
Signed-off-by: Charles <charles.bourque96@gmail.com>
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "wlan-cloud-owprov-ui",
|
||||
"version": "2.7.0(19)",
|
||||
"version": "2.7.0(20)",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "wlan-cloud-owprov-ui",
|
||||
"version": "2.7.0(19)",
|
||||
"version": "2.7.0(20)",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@chakra-ui/icons": "^1.1.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "wlan-cloud-owprov-ui",
|
||||
"version": "2.7.0(19)",
|
||||
"version": "2.7.0(20)",
|
||||
"description": "",
|
||||
"main": "index.tsx",
|
||||
"scripts": {
|
||||
|
||||
@@ -36,7 +36,9 @@ export const WebSocketProvider = ({ children }: { children: React.ReactElement }
|
||||
|
||||
const onStartWebSocket = () => {
|
||||
ws.current = new WebSocket(
|
||||
`${axiosProv?.defaults?.baseURL ? axiosProv.defaults.baseURL.replace('https', 'wss') : ''}/ws`,
|
||||
`${
|
||||
axiosProv?.defaults?.baseURL ? axiosProv.defaults.baseURL.replace('https', 'wss').replace('http', 'ws') : ''
|
||||
}/ws`,
|
||||
);
|
||||
ws.current.onopen = () => {
|
||||
setIsOpen(true);
|
||||
|
||||
@@ -9,7 +9,7 @@ const useApiRequirements = () => {
|
||||
if (!apiResult && isAccess) return `${secUrl.split('/api/v1')[0]}/wwwassets/access_policy.html`;
|
||||
if (!apiResult && !isAccess) return `${secUrl.split('/api/v1')[0]}/wwwassets/password_policy.html`;
|
||||
|
||||
if (apiResult?.startsWith('https')) return apiResult;
|
||||
if (apiResult?.startsWith('http')) return apiResult;
|
||||
return `${secUrl.split('/api/v1')[0]}${apiResult}`;
|
||||
};
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ const CirclePackSlider = ({ index, setIndex, points }) => {
|
||||
</Tooltip>
|
||||
</Slider>
|
||||
<Center>
|
||||
<Heading size="lg">{points[index] ? compactDate(points[index][0].timestamp) : ''}</Heading>
|
||||
<Heading size="lg">{points[index] && points[index][0] ? compactDate(points[index][0].timestamp) : ''}</Heading>
|
||||
</Center>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user