mirror of
https://github.com/styppo/hamstr.git
synced 2024-10-18 05:23:28 +00:00
Subscribe to user events after sign in, closes #28
This commit is contained in:
parent
a6adc94c1c
commit
fe54426f3a
@ -49,7 +49,7 @@ export default {
|
||||
useExtension: true,
|
||||
}
|
||||
this.settings.addAccount(account)
|
||||
this.settings.switchAccount(pubkey)
|
||||
this.app.switchAccount(pubkey)
|
||||
|
||||
this.nostr.getProfile(pubkey)
|
||||
},
|
||||
|
@ -115,7 +115,7 @@ export default {
|
||||
useExtension: true,
|
||||
}
|
||||
this.settings.addAccount(account)
|
||||
this.settings.switchAccount(pubkey)
|
||||
this.app.switchAccount(pubkey)
|
||||
|
||||
this.onComplete({pubkey})
|
||||
},
|
||||
|
@ -22,6 +22,7 @@
|
||||
import {decode as bech32decode} from 'bech32-buffer'
|
||||
import {bech32prefix, bech32ToHex} from 'src/utils/utils'
|
||||
import {useSettingsStore} from 'stores/Settings'
|
||||
import {useAppStore} from 'stores/App'
|
||||
|
||||
export default {
|
||||
name: 'SignInForm',
|
||||
@ -91,9 +92,8 @@ export default {
|
||||
opts = {privkey: bech32ToHex(this.key)}
|
||||
}
|
||||
|
||||
const settings = useSettingsStore()
|
||||
const account = settings.addAccount(opts)
|
||||
settings.switchAccount(account.pubkey)
|
||||
const account = useSettingsStore().addAccount(opts)
|
||||
useAppStore().switchAccount(account.pubkey)
|
||||
|
||||
this.$emit('complete', {pubkey: account.pubkey})
|
||||
},
|
||||
|
@ -37,10 +37,11 @@ export default {
|
||||
|
||||
const settings = useSettingsStore()
|
||||
const account = settings.addAccount({privkey})
|
||||
settings.switchAccount(account.pubkey)
|
||||
const app = useAppStore()
|
||||
app.switchAccount(account.pubkey)
|
||||
|
||||
const event = EventBuilder.metadata(account.pubkey, {name: this.username}).build()
|
||||
await useAppStore().signEvent(event)
|
||||
await app.signEvent(event)
|
||||
if (await useNostrStore().publish(event)) {
|
||||
this.$emit('complete', {
|
||||
pubkey: account.pubkey,
|
||||
|
Loading…
Reference in New Issue
Block a user