Add ability to join a space

This commit is contained in:
Jon Staab
2024-08-16 12:42:00 -07:00
parent 4cba0d9345
commit 0eb65be427
14 changed files with 264 additions and 148 deletions
+4 -1
View File
@@ -9,6 +9,7 @@
import {pushToast} from "@app/toast"
import {addSession} from "@app/base"
import {loadHandle} from "@app/state"
import {loadUserData} from "@app/commands"
const back = () => history.back()
@@ -23,9 +24,11 @@
})
}
const {pubkey} = handle
const {pubkey, relays = []} = handle
const broker = Nip46Broker.get(pubkey, secret, handler)
loadUserData(pubkey, relays)
if (await broker.connect()) {
addSession({method: "nip46", pubkey, secret, handler})
pushToast({message: "Successfully logged in!"})