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: faster profile creation #11061

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading