-
Notifications
You must be signed in to change notification settings - Fork 193
Conversation
setProfiles(env.profiles().all()); | ||
env.profiles() | ||
.all() | ||
.then((profiles: any) => setProfiles(profiles)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would a sync method have to use then
? https://github.com/ArkEcosystem/platform-sdk/blob/master/packages/platform-sdk-profiles/src/repositories/profile-repository.ts#L30-L32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you are right! I was just looking at the story https://github.com/ArkEcosystem/desktop-wallet/blob/3.0-react/src/domains/profile/pages/Welcome/Welcome.stories.tsx#L18-L30. So, for this case the promise will always log pending as long as its results are not resolved yet.
key={profile.id()} | ||
name={profile.name} | ||
avatar={profile.avatar} | ||
balance={profile.balance} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't exist on the profile yet.
balance="0" | ||
key={profile.id()} | ||
name={profile.name} | ||
avatar={profile.avatar} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avatar
is a method.
avatar={profile.avatar()} | ||
balance="0" | ||
key={profile.id()} | ||
name={profile.name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name
is a method.
name={profile.name} | ||
avatar={profile.avatar} | ||
balance={profile.balance} | ||
key={profile.id} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id
is a method.
export const Default = () => { | ||
const env = { | ||
profiles: () => ({ | ||
all: async () => new Promise((resolve) => resolve([])), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<div className="block w-12 h-12 mx-auto rounded-full sm:mx-0 sm:flex-shrink-0"> | ||
<img | ||
className="rounded-full" | ||
src={avatar} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The avatar is purely CSS, not an image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty much all changes in this PR revert things that were done on purpose because of how the SDK works and certain is provided. What's the reasoning for that?
My mistake sorry. PR closed! |
Summary
.then()
to capture promise resultsChecklist