mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-06-09 15:59:17 +02:00
minor adjustments/fixes
This commit is contained in:
parent
f4373be729
commit
d2708508c9
@ -5,7 +5,7 @@ import Donate from "@/components/Donate.vue";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Home",
|
name: "Home",
|
||||||
components: {Donate, Nip07, ResultsTable, ImageGeneration}
|
components: {Donate, Nip07, ImageGeneration}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -50,7 +50,6 @@ onClickOutside(target, ()=>emit('modal-close'))
|
|||||||
width: 400px;
|
width: 400px;
|
||||||
margin: 200px auto;
|
margin: 200px auto;
|
||||||
padding: 20px 30px;
|
padding: 20px 30px;
|
||||||
//background-color: #181818;
|
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
<div tabIndex={0} className="dropdown-content -start-44 z-[1] horizontal card card-compact w-64 p-2 shadow bg-primary text-primary-content">
|
<div tabIndex={0} className="dropdown-content -start-44 z-[1] horizontal card card-compact w-64 p-2 shadow bg-primary text-primary-content">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<h3 className="card-title">Nip07 Login</h3>
|
<h3 className="card-title">Nip07 Login</h3>
|
||||||
<p>Use a Browser Nip07 Extension like getalby or nos2x to login</p>
|
<p>Use a Browser Nip07 Extension like getalby or nos2x to login or use Amber on Android</p>
|
||||||
<button className="btn" @click="sign_in_nip07()">Browser Extension</button>
|
<button className="btn" @click="sign_in_nip07()">Browser Extension</button>
|
||||||
<template v-if="supports_android_signer">
|
<template v-if="supports_android_signer">
|
||||||
<button className="btn" @click="sign_in_amber()">Amber Sign in</button>
|
<button className="btn" @click="sign_in_amber()">Amber Sign in</button>
|
||||||
@ -89,6 +89,15 @@ export default {
|
|||||||
{
|
{
|
||||||
await this.sign_in_nip07()
|
await this.sign_in_nip07()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (localStorage.getItem('nostr-key-method') === 'android-signer')
|
||||||
|
{
|
||||||
|
let key = ""
|
||||||
|
if (localStorage.getItem('nostr-key') !== ""){
|
||||||
|
key = localStorage.getItem('nostr-key')
|
||||||
|
}
|
||||||
|
await this.sign_in_amber(key)
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
await this.sign_in_anon()
|
await this.sign_in_anon()
|
||||||
}
|
}
|
||||||
@ -220,7 +229,7 @@ export default {
|
|||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async sign_in_amber() {
|
async sign_in_amber(key="") {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
await loadWasmAsync();
|
await loadWasmAsync();
|
||||||
@ -238,7 +247,14 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const hexKey = await amberSignerService.getPublicKey();
|
try{
|
||||||
|
let hexKey = ""
|
||||||
|
if (key === ""){
|
||||||
|
hexKey = await amberSignerService.getPublicKey();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
hexKey = key
|
||||||
|
}
|
||||||
let publicKey = PublicKey.fromHex(hexKey);
|
let publicKey = PublicKey.fromHex(hexKey);
|
||||||
let keys = Keys.fromPublicKey(publicKey)
|
let keys = Keys.fromPublicKey(publicKey)
|
||||||
this.signer = ClientSigner.keys(keys)
|
this.signer = ClientSigner.keys(keys)
|
||||||
@ -252,8 +268,12 @@ export default {
|
|||||||
store.commit('set_pubkey', publicKey)
|
store.commit('set_pubkey', publicKey)
|
||||||
store.commit('set_hasEventListener', false)
|
store.commit('set_hasEventListener', false)
|
||||||
localStorage.setItem('nostr-key-method', "android-signer")
|
localStorage.setItem('nostr-key-method', "android-signer")
|
||||||
localStorage.setItem('nostr-key', "")
|
localStorage.setItem('nostr-key', hexKey)
|
||||||
await this.get_user_info(publicKey)
|
await this.get_user_info(publicKey)
|
||||||
|
}
|
||||||
|
catch (error){
|
||||||
|
alert(error)
|
||||||
|
}
|
||||||
|
|
||||||
//miniToastr.showMessage("Login successful!", "Logged in as " + publicKey.toHex(), VueNotifications.types.success)
|
//miniToastr.showMessage("Login successful!", "Logged in as " + publicKey.toHex(), VueNotifications.types.success)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user