Device manager - hide unverified security recommendation when only current session is unverified (PSG-639) (#9228)
* scroll to filtered list from security recommendations * test sessionmanager scroll to * stable snapshot * fix strict errors * prtidy * dont show security rec section when only curent session is unverified
This commit is contained in:
parent
219f4fae3d
commit
85f92308f9
3 changed files with 24 additions and 2 deletions
|
@ -29,11 +29,13 @@ import {
|
|||
|
||||
interface Props {
|
||||
devices: DevicesDictionary;
|
||||
currentDeviceId: DeviceWithVerification['device_id'];
|
||||
goToFilteredList: (filter: DeviceSecurityVariation) => void;
|
||||
}
|
||||
|
||||
const SecurityRecommendations: React.FC<Props> = ({
|
||||
devices,
|
||||
currentDeviceId,
|
||||
goToFilteredList,
|
||||
}) => {
|
||||
const devicesArray = Object.values<DeviceWithVerification>(devices);
|
||||
|
@ -41,7 +43,12 @@ const SecurityRecommendations: React.FC<Props> = ({
|
|||
const unverifiedDevicesCount = filterDevicesBySecurityRecommendation(
|
||||
devicesArray,
|
||||
[DeviceSecurityVariation.Unverified],
|
||||
).length;
|
||||
)
|
||||
// filter out the current device
|
||||
// as unverfied warning and actions
|
||||
// will be shown in current session section
|
||||
.filter((device) => device.device_id !== currentDeviceId)
|
||||
.length;
|
||||
const inactiveDevicesCount = filterDevicesBySecurityRecommendation(
|
||||
devicesArray,
|
||||
[DeviceSecurityVariation.Inactive],
|
||||
|
|
|
@ -62,7 +62,11 @@ const SessionManagerTab: React.FC = () => {
|
|||
}, [scrollIntoViewTimeoutRef]);
|
||||
|
||||
return <SettingsTab heading={_t('Sessions')}>
|
||||
<SecurityRecommendations devices={devices} goToFilteredList={onGoToFilteredList} />
|
||||
<SecurityRecommendations
|
||||
devices={devices}
|
||||
goToFilteredList={onGoToFilteredList}
|
||||
currentDeviceId={currentDeviceId}
|
||||
/>
|
||||
<CurrentDeviceSection
|
||||
device={currentDevice}
|
||||
isLoading={isLoading}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue