about summary refs log tree commit diff
path: root/src/state/models/profile-view.ts
diff options
context:
space:
mode:
authorMichael Staub <michael.staub@brightmachines.com>2023-02-23 16:34:25 -0800
committerMichael Staub <michael.staub@brightmachines.com>2023-02-23 16:34:25 -0800
commit693cbb9f18eeec48ea6ed3eb03ff3a96ca6ec7dc (patch)
tree192494fe0751aa279209f447587c311efcd33668 /src/state/models/profile-view.ts
parent23f07d8def1f4384022c7fecd0d7eac0ba8b2efc (diff)
parentbbd0b03a46b1087ecca17219441d060c2be69de2 (diff)
downloadvoidsky-693cbb9f18eeec48ea6ed3eb03ff3a96ca6ec7dc.tar.zst
Merge branch 'rnw' of github.com:bluesky-social/social-app into rnw
Diffstat (limited to 'src/state/models/profile-view.ts')
-rw-r--r--src/state/models/profile-view.ts20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/state/models/profile-view.ts b/src/state/models/profile-view.ts
index 8630eae52..0988367b6 100644
--- a/src/state/models/profile-view.ts
+++ b/src/state/models/profile-view.ts
@@ -1,5 +1,5 @@
 import {makeAutoObservable, runInAction} from 'mobx'
-import {PickedMedia} from 'view/com/util/images/image-crop-picker/ImageCropPicker'
+import {PickedMedia} from 'lib/media/picker'
 import {
   AppBskyActorGetProfile as GetProfile,
   AppBskyActorProfile as Profile,
@@ -137,11 +137,10 @@ export class ProfileViewModel {
     newUserBanner: PickedMedia | undefined,
   ) {
     if (newUserAvatar) {
-      const res = await this.rootStore.api.com.atproto.blob.upload(
-        newUserAvatar.path, // this will be special-cased by the fetch monkeypatch in /src/state/lib/api.ts
-        {
-          encoding: newUserAvatar.mime,
-        },
+      const res = await apilib.uploadBlob(
+        this.rootStore,
+        newUserAvatar.path,
+        newUserAvatar.mime,
       )
       updates.avatar = {
         cid: res.data.cid,
@@ -149,11 +148,10 @@ export class ProfileViewModel {
       }
     }
     if (newUserBanner) {
-      const res = await this.rootStore.api.com.atproto.blob.upload(
-        newUserBanner.path, // this will be special-cased by the fetch monkeypatch in /src/state/lib/api.ts
-        {
-          encoding: newUserBanner.mime,
-        },
+      const res = await apilib.uploadBlob(
+        this.rootStore,
+        newUserBanner.path,
+        newUserBanner.mime,
       )
       updates.banner = {
         cid: res.data.cid,