From 36ca0384b73ce2c89ec7c124ef36bf0a9c0f70ef Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 25 Oct 2023 15:19:40 -0300 Subject: [PATCH] fix: minor supported versions details (#5296) --- app/lib/methods/checkSupportedVersions.ts | 2 +- app/views/SidebarView/index.tsx | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/lib/methods/checkSupportedVersions.ts b/app/lib/methods/checkSupportedVersions.ts index 4aac383fe..bca4fd0a3 100644 --- a/app/lib/methods/checkSupportedVersions.ts +++ b/app/lib/methods/checkSupportedVersions.ts @@ -16,7 +16,7 @@ export const getMessage = ({ return; } const sortedMessages = messages.sort((a, b) => a.remainingDays - b.remainingDays); - return sortedMessages.find(({ remainingDays }) => moment(expiration).diff(new Date(), 'days') <= remainingDays); + return sortedMessages.find(({ remainingDays }) => moment(expiration).diff(new Date(), 'hours') <= remainingDays * 24); }; const getStatus = ({ expiration, message }: { expiration?: string; message?: TSVMessage }): TSVStatus => { diff --git a/app/views/SidebarView/index.tsx b/app/views/SidebarView/index.tsx index 6eb1e7bec..8e8976cf4 100644 --- a/app/views/SidebarView/index.tsx +++ b/app/views/SidebarView/index.tsx @@ -73,6 +73,7 @@ class Sidebar extends Component { useRealName, theme, Presence_broadcast_disabled, + supportedVersionsStatus, viewStatisticsPermission, viewRoomAdministrationPermission, viewUserAdministrationPermission, @@ -112,6 +113,9 @@ class Sidebar extends Component { if (nextProps.Presence_broadcast_disabled !== Presence_broadcast_disabled) { return true; } + if (nextProps.supportedVersionsStatus !== supportedVersionsStatus) { + return true; + } if (!dequal(nextProps.viewStatisticsPermission, viewStatisticsPermission)) { return true; }