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

feat: ⚡️ Ukraine relief feed #45

Merged
merged 3 commits into from
Mar 27, 2022
Merged

feat: ⚡️ Ukraine relief feed #45

merged 3 commits into from
Mar 27, 2022

Conversation

melMass
Copy link
Member

@melMass melMass commented Mar 25, 2022

  • feat:⚡️ first implementation of the ukraine feed
    Screenshot 2022-03-25 at 06 26 28

Closes #43

@render
Copy link

render bot commented Mar 25, 2022

@melMass
Copy link
Member Author

melMass commented Mar 25, 2022

@xat It's not super clean because I could not tailor the request only in graphQL, to get only the tokens array based on the factors I used (supply >1, verified, Shares > 50% for the relief contract). The js part might surely be better but I think it's a good starting point

@melMass
Copy link
Member Author

melMass commented Mar 26, 2022

@xat @AliaK77

So what do we do? I just rebased it and added the word Ukraine, not sure as it shifts the tags bar in two rows (like it was before we removed ATH a few issues ago so I'm not sure)

)

if (errors) {
console.error(errors)
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe throw or return here, because the code that follows expects a data object and will fail if it's undefined.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes tbh I copied the other methods but I usually try/catch those. We could also use the graph-ql package, it's very nice, I'm actually working on a little library wrapper that use most of the request we make here, I will propose it once I'm done :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm how are we handling them then? I never seem to be able to hit an error (providing a wrong address for instance).
I think this is because how it's handled in fetchGraphQL
I think it's out of scope for this issue

}
return undefined
}),
(token) => token !== undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this tokens? (plural?)

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean the last one? It's to filter undefined token (singular) in the tokens array

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, the last one. hmm, in the map function above you are returning contract.tokens (plural).

Copy link
Contributor

Choose a reason for hiding this comment

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

at least to me, it looks like the const tokens from line 261 contains an array of arrays.

Copy link
Member Author

Choose a reason for hiding this comment

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

True there might be better, but I'm deconstructing it line 274

Copy link
Member Author

Choose a reason for hiding this comment

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

Or are you just referring to renaming the variable token to token_list for instance line 271? 🤣

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, it's technically correct. just the variable name token could be changed to tokens

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahahaha! Will do those edits


objkts = objkts.concat(...tokens)
}
objkts = _.orderBy(objkts, ['timestamp'], ['desc'])
Copy link
Contributor

Choose a reason for hiding this comment

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

not that it matters, but you could directly return here.

Copy link
Contributor

@xat xat left a comment

Choose a reason for hiding this comment

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

nicely done!

@xat xat merged commit 2a4e7f1 into main Mar 27, 2022
@xat xat deleted the mel/feature/ukraine_relief branch March 27, 2022 21:02
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.

[feat] gallery/page for Ukraine fundraiser effort
2 participants