about summary refs log tree commit diff
path: root/src/state/models/profile-view.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2022-10-04 11:10:24 -0500
committerPaul Frazee <pfrazee@gmail.com>2022-10-04 11:10:24 -0500
commit0aaa406b179e366e6a527f052379184787440b42 (patch)
tree8e85b68c1557a9d3162e7bf1f3eaeda76950091d /src/state/models/profile-view.ts
parentbf39791f011f19c6ff192eb223e15259dc9de53a (diff)
downloadvoidsky-0aaa406b179e366e6a527f052379184787440b42.tar.zst
Implement profile-update api
Diffstat (limited to 'src/state/models/profile-view.ts')
-rw-r--r--src/state/models/profile-view.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/state/models/profile-view.ts b/src/state/models/profile-view.ts
index a7b8a7c7f..aa0040d65 100644
--- a/src/state/models/profile-view.ts
+++ b/src/state/models/profile-view.ts
@@ -88,11 +88,11 @@ export class ProfileViewModel {
     }
   }
 
-  async updateProfile(profile: Profile.Record) {
+  async updateProfile(fn: (existing?: Profile.Record) => Profile.Record) {
     if (this.did !== this.rootStore.me.did) {
       throw new Error('Not your profile!')
     }
-    await apilib.updateProfile(this.rootStore.api, this.did, profile)
+    await apilib.updateProfile(this.rootStore, fn)
     await this.refresh()
   }