From b493a7635a19a3bf66b471ad7d214d1db4f57f92 Mon Sep 17 00:00:00 2001 From: Jean Brito Date: Fri, 8 Sep 2023 15:34:13 -0300 Subject: [PATCH] ignore if there is no expirationMessage --- src/servers/supportedVersions/main.ts | 2 +- src/servers/supportedVersions/types.ts | 3 ++- src/ui/components/ServersView/UnsupportedServer.tsx | 9 +-------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/servers/supportedVersions/main.ts b/src/servers/supportedVersions/main.ts index 58bda1c85..25803927b 100644 --- a/src/servers/supportedVersions/main.ts +++ b/src/servers/supportedVersions/main.ts @@ -50,7 +50,7 @@ export function checkSupportedVersionServers(): void { (server) => server.url === action.payload.url && server.url === currentServerUrl ); - if (!server || !server.expirationMessage) return; + if (!server || server.expirationMessage === null) return; const { expirationMessage, expirationMessageLastTimeShown } = server; if (!expirationMessage) return; if ( diff --git a/src/servers/supportedVersions/types.ts b/src/servers/supportedVersions/types.ts index c379db94c..81f4f25a1 100644 --- a/src/servers/supportedVersions/types.ts +++ b/src/servers/supportedVersions/types.ts @@ -11,6 +11,7 @@ import { sampleServerSupportedVersions, } from './samples'; +// eslint-disable-next-line @typescript-eslint/no-unused-vars export type SerializedJWT = string; export type Dictionary = { @@ -225,7 +226,7 @@ export const getExpirationMessageTranslated = ( ...message?.params, }; - if (!message || !i18n) { + if (!message || !i18n || params.remaining_days > 15) { return null; } diff --git a/src/ui/components/ServersView/UnsupportedServer.tsx b/src/ui/components/ServersView/UnsupportedServer.tsx index f20875bee..652081407 100644 --- a/src/ui/components/ServersView/UnsupportedServer.tsx +++ b/src/ui/components/ServersView/UnsupportedServer.tsx @@ -1,11 +1,4 @@ -import { - Box, - Button, - ButtonGroup, - Icon, - Margins, - Skeleton, -} from '@rocket.chat/fuselage'; +import { Box, Button, ButtonGroup, Icon, Margins } from '@rocket.chat/fuselage'; import type { FC } from 'react'; import React from 'react'; import { useTranslation } from 'react-i18next';