fix(settings): hide list of webauthn devices if empty

- resolves https://github.com/nextcloud/server/issues/59339

If there are no devices the list would be empty.
This is invalid for accessibility, as every list needs at least one
listitem.
Ref: https://www.w3.org/TR/wai-aria-1.2/#mustContain

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2026-04-03 15:42:03 +02:00
parent 13583e8c6b
commit b060efaca4

View file

@ -9,20 +9,22 @@
<p class="settings-hint hidden-when-empty">
{{ t('settings', 'Set up your account for passwordless authentication following the FIDO2 standard.') }}
</p>
<NcNoteCard v-if="devices.length === 0" type="info">
{{ t('settings', 'No devices configured.') }}
</NcNoteCard>
<h3 v-else id="security-webauthn__active-devices">
{{ t('settings', 'The following devices are configured for your account:') }}
</h3>
<ul aria-labelledby="security-webauthn__active-devices" class="security-webauthn__device-list">
<WebAuthnDevice
v-for="device in sortedDevices"
:key="device.id"
:name="device.name"
@delete="deleteDevice(device.id)" />
</ul>
<template v-else>
<h3 id="security-webauthn__active-devices">
{{ t('settings', 'The following devices are configured for your account:') }}
</h3>
<ul aria-labelledby="security-webauthn__active-devices" class="security-webauthn__device-list">
<WebAuthnDevice
v-for="device in sortedDevices"
:key="device.id"
:name="device.name"
@delete="deleteDevice(device.id)" />
</ul>
</template>
<NcNoteCard v-if="!supportsWebauthn" type="warning">
{{ t('settings', 'Your browser does not support WebAuthn.') }}