Skip to content

Commit

Permalink
Use new room server & fix staged connections
Browse files Browse the repository at this point in the history
  • Loading branch information
arj03 committed Mar 7, 2022
1 parent d159592 commit b0218d0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
7 changes: 7 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@
<ssb-profile-link :feed="peer.data.key"></ssb-profile-link>
</div>

<br>

<b>Staged peers</b>
<div v-for="peer in stagedPeers">
<ssb-profile-link :feed="peer.data.key"></ssb-profile-link>
</div>

<transition name="modal" v-if="showGroupEdit">
<div class="modal-mask">
<div class="modal-wrapper">
Expand Down
12 changes: 10 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const menu = new Vue({
id: '',
groups: [],
peers: [],
stagedPeers: [],

activeId: '',

Expand Down Expand Up @@ -311,12 +312,19 @@ function setupApp(SSB) {
})
)

pull(
SSB.conn.stagedPeers(),
pull.drain((entries) => {
menu.stagedPeers = entries.filter(([, x]) => !!x.key).map(([address, data]) => ({ address, data }))
})
)

replicateSubfeeds(true, () => {
// timeout to make sure we get all feeds replicated
setTimeout(() => {
// auto connect to room
const roomKey = '@oPnjHuBpFNG+wXC1dzmdzvOO30mVNYmZB778fq3bn3Y=.ed25519'
const room = 'wss:between-two-worlds.dk:444~shs:oPnjHuBpFNG+wXC1dzmdzvOO30mVNYmZB778fq3bn3Y='
const roomKey = '@Px7ZxMT4mtpqiNH+PHyao9+o0RdQ/nzU5qznf7WMNIE=.ed25519'
const room = 'wss:between-two-worlds.dk:443~shs:Px7ZxMT4mtpqiNH+PHyao9+o0RdQ/nzU5qznf7WMNIE='

SSB.conn.connect(room, {
key: roomKey,
Expand Down

0 comments on commit b0218d0

Please sign in to comment.