Skip to content

Commit

Permalink
Add profiles and use the normal following for replicating feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
arj03 committed Nov 11, 2021
1 parent 5766f01 commit ca19d82
Show file tree
Hide file tree
Showing 6 changed files with 607 additions and 16 deletions.
29 changes: 27 additions & 2 deletions dist/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,30 @@ body {
height: 100%;
}

.avatarcontainer {
height: 30px;
padding: 3px;
}

.avatarlink {
cursor: pointer;
position: absolute;
}

.avatarlink > .img {
width: 30px;
height: 30px;
padding-right: 5px;
}

.avatarlink > .name {
position: absolute;
top: 5px;
display: block;
height: 30px;
left: 35px;
}

a {
color: #000;
text-decoration: underline;
Expand Down Expand Up @@ -102,8 +126,9 @@ ul.dashed {
flex-grow: 4;
}

#profile > span > .description h2 {
margin-top: 0;
#profile > span > .description > .feedId {
margin-bottom: 0.5rem;
font-size: .8rem;
}

#profile > h2 {
Expand Down
9 changes: 3 additions & 6 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
</head>
<body>
<div id="menu">
<b>Your ID</b>
<b>Profile</b>
<div>
{{ id.substring(0, 12) }}
<ssb-profile-link :feed="id"></ssb-profile-link>
</div>

<br>
Expand All @@ -29,9 +29,6 @@
<li class="link">
<span v-on:click="addGroupKey()" title="Add group key">Add group key</span>
</li>
<li class="link">
<span v-on:click="openProfile()" title="Profile">Profile</span>
</li>
<li class="link">
<span v-on:click="dumpDB()" title="Dump DB">Dump DB</span>
</li>
Expand All @@ -41,7 +38,7 @@

<b>Peers</b>
<div v-for="peer in peers">
{{ (peer.name || peer.data.name || peer.data.key).substring(0, 12) }}
<ssb-profile-link :feed="peer.data.key"></ssb-profile-link>
</div>
</div>
<div id="main">
Expand Down
20 changes: 20 additions & 0 deletions dist/noavatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 3 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ function getGroupKeysFeed(SSB, cb) {
})
}

// load ssb-profile-link
require('./ssb-profile-link')

const menu = new Vue({
el: '#menu',

Expand Down Expand Up @@ -277,14 +280,6 @@ function setupApp(SSB) {
}
}, 1000)

// main feed replicated on rpc connect
SSB.on('rpc:connect', function (rpc, isClient) {
if (rpc.id !== roomKey) {
console.log("request connect", rpc.id)
SSB.ebt.request(rpc.id, true)
}
})

// find all meta feeds & children and replicate those
pull(
SSB.db.query(
Expand Down
Loading

0 comments on commit ca19d82

Please sign in to comment.