Fix delete u2f keys bug (#18042)

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
Lunny Xiao 2021-12-21 04:53:25 +08:00 committed by GitHub
parent a818a48c76
commit 91f5be889a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@
{{range .U2FRegistrations}} {{range .U2FRegistrations}}
<div class="item"> <div class="item">
<div class="right floated content"> <div class="right floated content">
<button class="ui red tiny button delete-button" id="delete-registration" data-url="{{$.Link}}/u2f/delete" data-id="{{.ID}}"> <button class="ui red tiny button delete-button" modal-id="delete-registration" data-url="{{$.Link}}/u2f/delete" data-id="{{.ID}}">
{{$.i18n.Tr "settings.delete_key"}} {{$.i18n.Tr "settings.delete_key"}}
</button> </button>
</div> </div>

View File

@ -2959,8 +2959,8 @@ $(() => {
function showDeletePopup() { function showDeletePopup() {
const $this = $(this); const $this = $(this);
let filter = ''; let filter = '';
if ($this.attr('id')) { if ($this.attr('modal-id')) {
filter += `#${$this.attr('id')}`; filter += `#${$this.attr('modal-id')}`;
} }
const dialog = $(`.delete.modal${filter}`); const dialog = $(`.delete.modal${filter}`);