Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Avoid multiple removal of Credentials and Pairing Keys. #381

Conversation

a-martynovich
Copy link
Contributor

@a-martynovich a-martynovich commented Aug 23, 2019

Fixes #379 and part of #380.

@a-martynovich a-martynovich changed the title Avoid multiple removal of Credentials. Avoid multiple removal of Credentials and Pairing Keys. Aug 23, 2019
@a-martynovich a-martynovich force-pushed the 379-fix-credentials-multiple-removal branch from 42b6dca to 476db1d Compare August 27, 2019 09:21
@@ -459,12 +459,11 @@ <h6 class="card-subtitle text-muted">View credentials.</h6>
let data = table.row( $(this).parents('tr') ).data();
deleted_pk = data.pk;

$('#confirm-btn').on('click', delete_credential );
show_confirm_dialog( "Confirm Removal", "Are you sure you want to delete?", "Delete" );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was in use one confirmation dialog for several confirmations. And to move it (html dialog template and function) to separate utils file may be.
So, if we plan to move repeated code to somewhere library like in future, may be it would be better to use something like code below or even move it inside a function

$('#confirm-btn').off('click');
$('#confirm-btn').on('click', delete_credential );
show_confirm_dialog( "Confirm Removal", "Are you sure you want to delete?", "Delete" );

If not, then your variant is fine

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple removal on Credentials page
3 participants