From 84b2a15c65b89e84c4607134ab9d1d14b1edc485 Mon Sep 17 00:00:00 2001 From: Hailey Date: Sun, 1 Dec 2024 18:23:25 -0800 Subject: [PATCH 1/2] Discard changes to src/screens/Onboarding/StepProfile/index.tsx --- src/screens/Onboarding/StepProfile/index.tsx | 36 +------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/src/screens/Onboarding/StepProfile/index.tsx b/src/screens/Onboarding/StepProfile/index.tsx index 13507443fe3..73472ec3326 100644 --- a/src/screens/Onboarding/StepProfile/index.tsx +++ b/src/screens/Onboarding/StepProfile/index.tsx @@ -1,6 +1,5 @@ import React from 'react' import {View} from 'react-native' -import * as Clipboard from 'expo-clipboard' import {Image as ExpoImage} from 'expo-image' import { ImagePickerOptions, @@ -10,7 +9,6 @@ import { import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' -import {uploadBlob} from '#/lib/api' import {usePhotoLibraryPermission} from '#/lib/hooks/usePermissions' import {compressIfNeeded} from '#/lib/media/manip' import {openCropper} from '#/lib/media/picker' @@ -18,7 +16,6 @@ import {getDataUriSize} from '#/lib/media/util' import {useRequestNotificationsPermission} from '#/lib/notifications/notifications' import {logEvent, useGate} from '#/lib/statsig/statsig' import {isNative, isWeb} from '#/platform/detection' -import {useAgent} from '#/state/session' import { DescriptionText, OnboardingControls, @@ -159,38 +156,7 @@ export function StepProfile() { logEvent('onboarding:profile:nextPressed', {}) }, [avatar, dispatch]) - const agent = useAgent() - - const onDoneCreating = React.useCallback(async () => { - const imageUri = await canvasRef.current?.capture() - console.log(imageUri) - // copy to clipbaord - await Clipboard.setStringAsync(imageUri ?? '') - - const blobPromise = await uploadBlob(agent, imageUri ?? '', 'image/jpeg') - - const blob = blobPromise.data.blob - - const command = `go run ./cmd/doppel addDefaultAvi --did ${agent.did} --cid ${blob.ref}` - - await agent.upsertProfile(async existing => { - existing = existing ?? {} - if (blobPromise) { - const res = await blobPromise - if (res.data.blob) { - existing.avatar = res.data.blob - } - } - - existing.displayName = '' - return existing - }) - - await Clipboard.setStringAsync(command) - console.log(command) - - return - + const onDoneCreating = React.useCallback(() => { setAvatar(prev => ({ ...prev, image: undefined, From d04654dbaff25b2ce5c316e56ea9bbd5ea89492f Mon Sep 17 00:00:00 2001 From: Hailey Date: Sun, 1 Dec 2024 18:24:54 -0800 Subject: [PATCH 2/2] oops --- package.json | 2 +- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d3df65cec36..ffa4a63a402 100644 --- a/package.json +++ b/package.json @@ -246,7 +246,7 @@ "husky": "^8.0.3", "is-ci": "^3.0.1", "jest": "^29.7.0", - "jest-expo": "^52.0.0-preview.4", + "jest-expo": "^52.0.2", "jest-junit": "^16.0.0", "lint-staged": "^13.2.3", "metro-react-native-babel-preset": "^0.76.9", diff --git a/yarn.lock b/yarn.lock index cc5828ed92e..40fbe4de7c2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12541,7 +12541,7 @@ jest-environment-node@^29.7.0: jest-mock "^29.7.0" jest-util "^29.7.0" -jest-expo@^52.0.0-preview.4: +jest-expo@^52.0.2: version "52.0.2" resolved "https://registry.yarnpkg.com/jest-expo/-/jest-expo-52.0.2.tgz#84aed0f7b58683143c63bff0e0e35bec925bcdfd" integrity sha512-6xV/+IRw93Org1UlgIqu89Ex3vuPRozD5VqTS95AonHMgjb0XTHHhMmn+TdR1d3i3ziy7JFbWAMoBLwminIalw==