Skip to content

Commit 6d5ee32

Browse files
refactor(cc-ssh-key-list): avoid setting both disabled & waiting at the same time
Fixes #1124
1 parent 2f1af6e commit 6d5ee32

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/components/cc-ssh-key-list/cc-ssh-key-list.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,12 @@ export class CcSshKeyList extends LitElement {
285285
(key) => key.name,
286286
(key) => {
287287
const name = key.name;
288-
const isDisabled = !skeleton && key.state !== 'idle';
288+
const isWaiting = !skeleton && key.state !== 'idle';
289289
const classes = {
290290
'key--personal': type === 'personal',
291291
'key--github': type === 'github',
292292
'key--skeleton': skeleton,
293-
'is-disabled': isDisabled,
293+
'is-waiting': isWaiting,
294294
};
295295
296296
return html`
@@ -311,10 +311,9 @@ export class CcSshKeyList extends LitElement {
311311
a11y-name="${i18n('cc-ssh-key-list.personal.delete.a11y', { name })}"
312312
class="key__button key__button--personal"
313313
.icon="${iconBin}"
314-
?disabled=${isDisabled}
315314
danger
316315
outlined
317-
?waiting=${isDisabled}
316+
?waiting=${isWaiting}
318317
>
319318
${i18n('cc-ssh-key-list.personal.delete')}
320319
</cc-button>
@@ -327,8 +326,7 @@ export class CcSshKeyList extends LitElement {
327326
a11y-name="${i18n('cc-ssh-key-list.github.import.a11y', { name })}"
328327
class="key__button key__button--github"
329328
.icon="${iconAdd}"
330-
?disabled=${isDisabled}
331-
?waiting=${isDisabled}
329+
?waiting=${isWaiting}
332330
>
333331
${i18n('cc-ssh-key-list.github.import')}
334332
</cc-button>
@@ -401,7 +399,7 @@ export class CcSshKeyList extends LitElement {
401399
grid-template-columns: min-content 1fr;
402400
}
403401
404-
.key.is-disabled {
402+
.key.is-waiting {
405403
cursor: default;
406404
opacity: var(--cc-opacity-when-disabled);
407405
}

0 commit comments

Comments
 (0)