Skip to content

Commit f4927bb

Browse files
committed
Significant API updates.
1 parent d544225 commit f4927bb

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/api.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ export async function getProfile(state) {
3838
return profile;
3939
}
4040

41-
export async function getMyGists(state) {
42-
const {data:gists} = await u.listGists();
41+
export async function getMyGists(state, {memory: memory = false} = {}) {
42+
let {data:gists} = await u.listGists();
43+
if ( ! memory ) {
44+
const key = getMemoryKey(state);
45+
gists = gists.filter(g => g.description !== key);
46+
}
4347
state.gists = gists;
4448
return gists;
4549
}
@@ -101,8 +105,8 @@ export async function newPost(submitEvent, state) {
101105
description: form.description.value,
102106
public: true,
103107
files: {
104-
['post.md']: {
105-
filename: 'post.md',
108+
['barn.md']: {
109+
filename: 'barn.md',
106110
content: form.content.value
107111
}
108112
}
@@ -195,7 +199,7 @@ export async function getMemory(state) {
195199
return {memory:state.memory, memoryGist:state.memoryGist};
196200
}
197201
try {
198-
const gists = await getMyGists(state);
202+
const gists = await getMyGists(state, {memory:true});
199203
const description = getMemoryKey(state);
200204
let memoryGistItem = gists.find(g => g.description == description);
201205
const memoryGist = g.getGist(memoryGistItem.id);

src/views/Discover.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function Discover(state) {
1212
${state.discover ? state.discover.map(login => R`${{key:login}}
1313
<li>
1414
<a href=#follow-${login} click=${async e => {
15-
followUser(login, state);
15+
await followUser(login, state);
1616
App(state);
1717
}}>${login}</a>
1818
</li>

0 commit comments

Comments
 (0)