mirror of
https://github.com/styppo/hamstr.git
synced 2024-10-18 13:33:22 +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,
|
useExtension: true,
|
||||||
}
|
}
|
||||||
this.settings.addAccount(account)
|
this.settings.addAccount(account)
|
||||||
this.settings.switchAccount(pubkey)
|
this.app.switchAccount(pubkey)
|
||||||
|
|
||||||
this.nostr.getProfile(pubkey)
|
this.nostr.getProfile(pubkey)
|
||||||
},
|
},
|
||||||
|
@ -115,7 +115,7 @@ export default {
|
|||||||
useExtension: true,
|
useExtension: true,
|
||||||
}
|
}
|
||||||
this.settings.addAccount(account)
|
this.settings.addAccount(account)
|
||||||
this.settings.switchAccount(pubkey)
|
this.app.switchAccount(pubkey)
|
||||||
|
|
||||||
this.onComplete({pubkey})
|
this.onComplete({pubkey})
|
||||||
},
|
},
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
import {decode as bech32decode} from 'bech32-buffer'
|
import {decode as bech32decode} from 'bech32-buffer'
|
||||||
import {bech32prefix, bech32ToHex} from 'src/utils/utils'
|
import {bech32prefix, bech32ToHex} from 'src/utils/utils'
|
||||||
import {useSettingsStore} from 'stores/Settings'
|
import {useSettingsStore} from 'stores/Settings'
|
||||||
|
import {useAppStore} from 'stores/App'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SignInForm',
|
name: 'SignInForm',
|
||||||
@ -91,9 +92,8 @@ export default {
|
|||||||
opts = {privkey: bech32ToHex(this.key)}
|
opts = {privkey: bech32ToHex(this.key)}
|
||||||
}
|
}
|
||||||
|
|
||||||
const settings = useSettingsStore()
|
const account = useSettingsStore().addAccount(opts)
|
||||||
const account = settings.addAccount(opts)
|
useAppStore().switchAccount(account.pubkey)
|
||||||
settings.switchAccount(account.pubkey)
|
|
||||||
|
|
||||||
this.$emit('complete', {pubkey: account.pubkey})
|
this.$emit('complete', {pubkey: account.pubkey})
|
||||||
},
|
},
|
||||||
|
@ -37,10 +37,11 @@ export default {
|
|||||||
|
|
||||||
const settings = useSettingsStore()
|
const settings = useSettingsStore()
|
||||||
const account = settings.addAccount({privkey})
|
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()
|
const event = EventBuilder.metadata(account.pubkey, {name: this.username}).build()
|
||||||
await useAppStore().signEvent(event)
|
await app.signEvent(event)
|
||||||
if (await useNostrStore().publish(event)) {
|
if (await useNostrStore().publish(event)) {
|
||||||
this.$emit('complete', {
|
this.$emit('complete', {
|
||||||
pubkey: account.pubkey,
|
pubkey: account.pubkey,
|
||||||
|
Loading…
Reference in New Issue
Block a user