feat: hide empty webauthn devices table when there are no devices (#4405)
parent
6f8b6adfb5
commit
2967500401
|
@ -83,34 +83,34 @@ export default function TwoFactorAuthSettings(props: Props) {
|
||||||
{"Add new device"}
|
{"Add new device"}
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
{webauthnDevices ? (
|
||||||
<Table>
|
<Box>
|
||||||
<TableHead>
|
<Table>
|
||||||
<TableRow>
|
<TableHead>
|
||||||
<TableCell />
|
<TableRow>
|
||||||
<TableCell>{translate("Name")}</TableCell>
|
<TableCell />
|
||||||
<TableCell>{translate("Enabled")}</TableCell>
|
<TableCell>{translate("Name")}</TableCell>
|
||||||
<TableCell align="center">{translate("Actions")}</TableCell>
|
<TableCell>{translate("Enabled")}</TableCell>
|
||||||
</TableRow>
|
<TableCell align="center">{translate("Actions")}</TableCell>
|
||||||
</TableHead>
|
</TableRow>
|
||||||
<TableBody>
|
</TableHead>
|
||||||
{webauthnDevices
|
<TableBody>
|
||||||
? webauthnDevices.map((x, idx) => {
|
{webauthnDevices.map((x, idx) => {
|
||||||
return (
|
return (
|
||||||
<WebauthnDeviceItem
|
<WebauthnDeviceItem
|
||||||
device={x}
|
device={x}
|
||||||
idx={idx}
|
idx={idx}
|
||||||
webauthnShowDetails={webauthnShowDetails}
|
webauthnShowDetails={webauthnShowDetails}
|
||||||
handleWebAuthnDetailsChange={handleWebAuthnDetailsChange}
|
handleWebAuthnDetailsChange={handleWebAuthnDetailsChange}
|
||||||
handleDeleteItem={handleDeleteItem}
|
handleDeleteItem={handleDeleteItem}
|
||||||
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