random bun scripts that dont fit anywhere else
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: allow using the enter key to add users

dunkirk.sh b4b2538d 3935d917

verified
+20 -8
+20 -8
bluesky-community-verifications.js
··· 472 472 }); 473 473 } 474 474 }; 475 - 476 475 // Function to create the settings modal 477 476 const createSettingsModal = () => { 478 477 // Create modal container ··· 581 580 settingsModal.style.display = "none"; 582 581 }); 583 582 583 + // Function to add a user from the input field 584 + const addUserFromInput = () => { 585 + const input = document.getElementById("trustedUserInput"); 586 + const handle = input.value.trim(); 587 + if (handle) { 588 + addTrustedUser(handle); 589 + input.value = ""; 590 + updateTrustedUsersList(); 591 + } 592 + }; 593 + 584 594 // Add trusted user button event 585 595 document 586 596 .getElementById("addTrustedUserBtn") 587 - .addEventListener("click", () => { 588 - const input = document.getElementById("trustedUserInput"); 589 - const handle = input.value.trim(); 590 - if (handle) { 591 - addTrustedUser(handle); 592 - input.value = ""; 593 - updateTrustedUsersList(); 597 + .addEventListener("click", addUserFromInput); 598 + 599 + // Add keydown event to input for Enter key 600 + document 601 + .getElementById("trustedUserInput") 602 + .addEventListener("keydown", (e) => { 603 + if (e.key === "Enter") { 604 + e.preventDefault(); 605 + addUserFromInput(); 594 606 } 595 607 }); 596 608