Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings following #24

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Settings following #24

wants to merge 21 commits into from

Conversation

nickbytes
Copy link
Contributor

turning this into a PR so we can comment on it

@nickbytes
Copy link
Contributor Author

Wondering: keep all actions at the App.js level or move to their containers? Getting awfully close to considering something redux-y... I really like https://github.com/jxnblk/refunk maybe a nice slimmed down alternative. Probably nothing to worry about now though.

@nickbytes
Copy link
Contributor Author

Actually, this is still clean af. Let's keep it for a bit. Might get a little ridiculous using that many render props... but we're like... almost done with v1.

v2 might need more organization for following.

@jayres
Copy link
Collaborator

jayres commented Aug 20, 2018

There are a LOT of improvements here and functionality BUT....

It looks like while you're refactoring the posts query stuff directly in master you ended up breaking the followers code that was in this repo. We probably don't want to merge this before you push some fixes to master about that code and then we remerge.

@nickbytes
Copy link
Contributor Author

NOT DIRECTLY IN MASTER

};
}

async componentDidMount() {
try {
const archive = await new global.DatArchive(urlEnv());
const archiveInfo = await archive.getInfo();
const allPosts = await this.getAllPosts(archive);
const results = await this.refreshPosts(archive);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a faulty merge going on here, starting with this line. We want the getAllPosts stuff

const userData = await this.getUserInfo(archive);

this.setState({
correctBrowser: true,
posts: allPosts,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this

* returns all of their posts.
* It does not setState.
*/
getAllPosts = async archive => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refreshPosts is now getAllPosts

* Exact same as the above function, but
* also sets state.
*/
getAllPostsSaved = async archive => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new function. Similar to the old refreshPosts, but it also does setState

@@ -94,9 +94,7 @@ class App extends Component {
return JSON.parse(postResponse);
});
const results = await Promise.all(promises);
this.setState({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need this

this.state.postDisplay === 'theirs'
? this.state.theirPosts
: this.state.posts
)}
isOwner={this.state.isOwner}
getPosts={this.getAllPostsSaved}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of those new functions referenced here

@@ -0,0 +1,8 @@
const profileContents = userData => `{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be refactored to something like fileContents.js

const profileContents = userData =>   
  JSON.stringify({
    avatar: userData.avatar,
    bio: userData.bio,
    name: userData.name,
    follows: userData.follows
  });

 export default profileContents;

James Ayres added 2 commits August 20, 2018 10:16
@nickbytes
Copy link
Contributor Author

i dont know whats going on in this branch anymore, but p sure its stuxnet

@nickbytes
Copy link
Contributor Author

wutdude

@nickbytes
Copy link
Contributor Author

wow

@nickbytes
Copy link
Contributor Author

screen shot 2018-08-20 at 10 40 31 am

@nickbytes
Copy link
Contributor Author

nickbytes commented Aug 20, 2018

If this works locally for you, and it includes whatever else is already in master, please merge. I don't ever want to look at this branch again

let's create another branch instead of merging this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants