tell user if can't sign up because no extension

This commit is contained in:
counterweight 2025-02-13 00:28:09 +01:00
parent 3327b6a1ee
commit 805ad5fad9
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
2 changed files with 33 additions and 2 deletions

View file

@ -1,6 +1,15 @@
window.onload = function () {
if (!window.nostr) {
console.log("Nostr extension not present");
document.querySelector('#nostr-signup').disabled = true;
document.querySelector('#no-extension-nudges').style.display = 'block';
} else {
console.log("Nostr extension present");
}
}
async function acceptInvite() {
// check if there is nostr extension
if (!window.nostr) {
console.log("No Nostr extension found.");
return { success: false, error: "No Nostr extension detected." };