feat: hide empty webauthn devices table when there are no devices (#4405)
parent
6f8b6adfb5
commit
2967500401
|
@ -83,6 +83,7 @@ export default function TwoFactorAuthSettings(props: Props) {
|
||||||
{"Add new device"}
|
{"Add new device"}
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
|
{webauthnDevices ? (
|
||||||
<Box>
|
<Box>
|
||||||
<Table>
|
<Table>
|
||||||
<TableHead>
|
<TableHead>
|
||||||
|
@ -94,8 +95,7 @@ export default function TwoFactorAuthSettings(props: Props) {
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{webauthnDevices
|
{webauthnDevices.map((x, idx) => {
|
||||||
? webauthnDevices.map((x, idx) => {
|
|
||||||
return (
|
return (
|
||||||
<WebauthnDeviceItem
|
<WebauthnDeviceItem
|
||||||
device={x}
|
device={x}
|
||||||
|
@ -106,11 +106,11 @@ export default function TwoFactorAuthSettings(props: Props) {
|
||||||
key={`webauthn-device-${idx}`}
|
key={`webauthn-device-${idx}`}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})
|
})}
|
||||||
: null}
|
|
||||||
</TableBody>
|
</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
</Box>
|
</Box>
|
||||||
|
) : null}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
Loading…
Reference in New Issue