diff options
author | Paul Frazee <pfrazee@gmail.com> | 2024-11-23 16:20:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-23 16:20:24 -0800 |
commit | 32bf8122e8c8a0fbadd53b8a015cfbc9014519a2 (patch) | |
tree | 55bd24596e6fadadbf4326b26e3d14e418c5c7bb /src/screens/Onboarding/StepFinished.tsx | |
parent | 523d1f01a51c0e85e49916fb42b204f7004ffac1 (diff) | |
parent | b4d07c4112b9a62b5380948051aa4a7fd391a2d4 (diff) | |
download | voidsky-32bf8122e8c8a0fbadd53b8a015cfbc9014519a2.tar.zst |
Merge branch 'main' into main
Diffstat (limited to 'src/screens/Onboarding/StepFinished.tsx')
-rw-r--r-- | src/screens/Onboarding/StepFinished.tsx | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/src/screens/Onboarding/StepFinished.tsx b/src/screens/Onboarding/StepFinished.tsx index fdc0a3eb7..0d8971b6f 100644 --- a/src/screens/Onboarding/StepFinished.tsx +++ b/src/screens/Onboarding/StepFinished.tsx @@ -127,31 +127,36 @@ export function StepFinished() { })(), (async () => { const {imageUri, imageMime} = profileStepResults - if (imageUri && imageMime) { - const blobPromise = uploadBlob(agent, imageUri, imageMime) - await agent.upsertProfile(async existing => { - existing = existing ?? {} + const blobPromise = + imageUri && imageMime + ? uploadBlob(agent, imageUri, imageMime) + : undefined + + await agent.upsertProfile(async existing => { + existing = existing ?? {} + + if (blobPromise) { const res = await blobPromise if (res.data.blob) { existing.avatar = res.data.blob } + } - if (starterPack) { - existing.joinedViaStarterPack = { - uri: starterPack.uri, - cid: starterPack.cid, - } + if (starterPack) { + existing.joinedViaStarterPack = { + uri: starterPack.uri, + cid: starterPack.cid, } + } - existing.displayName = '' - // HACKFIX - // creating a bunch of identical profile objects is breaking the relay - // tossing this unspecced field onto it to reduce the size of the problem - // -prf - existing.createdAt = new Date().toISOString() - return existing - }) - } + existing.displayName = '' + // HACKFIX + // creating a bunch of identical profile objects is breaking the relay + // tossing this unspecced field onto it to reduce the size of the problem + // -prf + existing.createdAt = new Date().toISOString() + return existing + }) logEvent('onboarding:finished:avatarResult', { avatarResult: profileStepResults.isCreatedAvatar |