fix: minor supported versions details (#5296)

This commit is contained in:
Diego Mello 2023-10-25 15:19:40 -03:00 committed by GitHub
parent 13af95f8cb
commit 36ca0384b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -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 => {

View File

@ -73,6 +73,7 @@ class Sidebar extends Component<ISidebarProps, ISidebarState> {
useRealName,
theme,
Presence_broadcast_disabled,
supportedVersionsStatus,
viewStatisticsPermission,
viewRoomAdministrationPermission,
viewUserAdministrationPermission,
@ -112,6 +113,9 @@ class Sidebar extends Component<ISidebarProps, ISidebarState> {
if (nextProps.Presence_broadcast_disabled !== Presence_broadcast_disabled) {
return true;
}
if (nextProps.supportedVersionsStatus !== supportedVersionsStatus) {
return true;
}
if (!dequal(nextProps.viewStatisticsPermission, viewStatisticsPermission)) {
return true;
}