tell user if can't sign up because no extension
This commit is contained in:
parent
3327b6a1ee
commit
805ad5fad9
2 changed files with 33 additions and 2 deletions
|
|
@ -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." };
|
||||
|
|
|
|||
|
|
@ -15,8 +15,30 @@
|
|||
</p>
|
||||
<p>Usa tu extensión de Nostr para darte de alta:</p>
|
||||
<form onsubmit="acceptInvite();return false">
|
||||
<button type="submit">Alta con Nostr</button>
|
||||
<button id="nostr-signup" type="submit">Alta con Nostr</button>
|
||||
</form>
|
||||
<div id="no-extension-nudges" style="display:none">
|
||||
<p>¡Atención! No se ha encontrado una extensión de Nostr en tu navegador. Puedes usar: </p>
|
||||
<ul>
|
||||
<li>Firefox
|
||||
<ul>
|
||||
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/alby/" target="_blank"
|
||||
rel="noopener noreferrer">Alby</a></li>
|
||||
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/nos2x-fox/" target="_blank"
|
||||
rel="noopener noreferrer">nos2x-fox</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
Chrome
|
||||
<ul>
|
||||
<li><a href="https://chromewebstore.google.com/detail/alby-bitcoin-wallet-for-l/iokeahhehimjnekafflcihljlcjccdbe?pli=1"
|
||||
target="_blank" rel="noopener noreferrer">Alby</a></li>
|
||||
<li><a href="https://chromewebstore.google.com/detail/nos2x/kpgefcfmnafjgpblomihpgmejjdanjjp"
|
||||
target="_blank" rel="noopener noreferrer">nos2x</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>¿No tienes cuenta de Nostr? <a href="https://start.njump.me/" target="_blank" rel="noopener noreferrer">Crea
|
||||
una aquí.</a< /p>
|
||||
</body>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue