fix: unselect pin on click

This commit is contained in:
relikd
2024-07-22 20:31:56 +02:00
parent 880c7a9bfa
commit 968e46d3db

View File

@@ -86,7 +86,11 @@ function selectPin(e) {
} }
function unselectPin(e) { function unselectPin(e) {
document.getElementById('pin-' + e.target.dataset.pk) unselectPinById(e.target.dataset.pk);
}
function unselectPinById(pid) {
document.getElementById('pin-' + pid)
.parentNode.classList.remove('selected'); .parentNode.classList.remove('selected');
} }
@@ -303,6 +307,7 @@ async function start() {
function onHashChange() { function onHashChange() {
if (location.hash.length > 1) { if (location.hash.length > 1) {
const [id, pw] = location.hash.slice(1).split(':', 1); const [id, pw] = location.hash.slice(1).split(':', 1);
unselectPinById(id);
openDetails(id, pw); openDetails(id, pw);
} else { } else {
clearDetails(); clearDetails();