Skip to content

Commit

Permalink
Merge pull request kodadot#11061 from hassnian/issue-faster-profile-u…
Browse files Browse the repository at this point in the history
…ploads

feat: faster profile creation
  • Loading branch information
vikiival authored Sep 30, 2024
2 parents 3d2acdf + 7478fa9 commit ad25fdd
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions composables/useUpdateProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,22 @@ export default async ({
hasProfile: boolean
useFarcaster: boolean
}) => {
const imageUrl = profileData.image
? await uploadProfileImage({
file: profileData.image,
type: 'image',
signaturePair,
})
: profileData.imagePreview

const bannerUrl = profileData.banner
? await uploadProfileImage({
file: profileData.banner,
type: 'banner',
signaturePair,
})
: profileData.bannerPreview
const [imageUrl, bannerUrl] = await Promise.all([
profileData.image
? uploadProfileImage({
file: profileData.image,
type: 'image',
signaturePair,
})
: Promise.resolve(profileData.imagePreview),
profileData.banner
? uploadProfileImage({
file: profileData.banner,
type: 'banner',
signaturePair,
})
: Promise.resolve(profileData.bannerPreview),
])

const profileBody: CreateProfileRequest | UpdateProfileRequest = {
address: profileData.address,
Expand Down

0 comments on commit ad25fdd

Please sign in to comment.