Skip to content

Commit

Permalink
Merge branch 'hailey/upgrade-clean' into hailey/test-upgrade-build
Browse files Browse the repository at this point in the history
  • Loading branch information
haileyok committed Dec 2, 2024
2 parents 98dd911 + d04654d commit 7bfb661
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 37 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
36 changes: 1 addition & 35 deletions src/screens/Onboarding/StepProfile/index.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -10,15 +9,13 @@ 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'
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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==
Expand Down

0 comments on commit 7bfb661

Please sign in to comment.