Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5b66ef0

Browse files
committed
Added self as follower.
1 parent f4927bb commit 5b66ef0

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/api.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,24 @@ export async function getMyGists(state, {memory: memory = false} = {}) {
4343
if ( ! memory ) {
4444
const key = getMemoryKey(state);
4545
gists = gists.filter(g => g.description !== key);
46+
state.gists = gists;
4647
}
47-
state.gists = gists;
4848
return gists;
4949
}
5050

5151
export async function getItsGists(state, user) {
52+
5253
if ( ! state.userGists ) {
5354
state.userGists = new Map();
5455
} else if ( state.userGists.has(user) ) return state.userGists.get(user);
55-
const {data:gists} = await g.getUser(user).listGists();
56+
57+
let gists;
58+
if ( state.name == user ) {
59+
gists = await getMyGists(state);
60+
} else {
61+
({data:gists} = await g.getUser(user).listGists());
62+
}
63+
5664
sortPostsByMostRecent(gists);
5765
state.userGists.set(user, gists);
5866
return gists;
@@ -62,6 +70,7 @@ export async function getBaseFollowers(state) {
6270
const {followers_url} = state.profileData;
6371
const followers = await fetch(followers_url).then(r => r.json());
6472
state.followers = followers;
73+
followers.unshift(state.profileData);
6574
return followers;
6675
}
6776

src/views/Discover.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ export default function Discover(state) {
66
return R`
77
<div class=discover>
88
<h1>Discover others</h1>
9-
<p>
10-
Follow the followers of your followers, or the followers of those you follow.
119
<ul>
1210
${state.discover ? state.discover.map(login => R`${{key:login}}
1311
<li>

0 commit comments

Comments
 (0)