diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-09-07 16:00:25 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-09-07 16:00:25 -0500 |
commit | 9010078489eae77c620a3bf4802ff6b417ea31f9 (patch) | |
tree | 11c5c03099a5cda82161d077efd3d50525dd8487 /src/state/models/profile-view.ts | |
parent | 5ae39612d7e8484ffc5be6c7c5dc0f878985c676 (diff) | |
download | voidsky-9010078489eae77c620a3bf4802ff6b417ea31f9.tar.zst |
Add EditProfile modal
Diffstat (limited to 'src/state/models/profile-view.ts')
-rw-r--r-- | src/state/models/profile-view.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/state/models/profile-view.ts b/src/state/models/profile-view.ts index 89c8a75d0..42c3737e9 100644 --- a/src/state/models/profile-view.ts +++ b/src/state/models/profile-view.ts @@ -89,6 +89,14 @@ export class ProfileViewModel implements bsky.ProfileView.Response { } } + async updateProfile(profile: bsky.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 this.refresh() + } + // state transitions // = |