WIP PWA for Grain
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: preserve existing avatar blob when profile is updated

+12 -2
+3
src/components/pages/grain-edit-profile.js
··· 290 290 }; 291 291 } else if (this._avatarRemoved) { 292 292 input.avatar = null; 293 + } else if (this._originalProfile?.avatarBlob) { 294 + // Preserve existing avatar 295 + input.avatar = this._originalProfile.avatarBlob; 293 296 } 294 297 295 298 await client.mutate(UPDATE_PROFILE_MUTATION, { rkey: 'self', input });
+9 -2
src/services/grain-api.js
··· 822 822 socialGrainActorProfileByDid { 823 823 displayName 824 824 description 825 - avatar { url } 825 + avatar { url ref mimeType size } 826 826 } 827 827 } 828 828 } ··· 830 830 831 831 const viewer = result.viewer; 832 832 const profile = viewer?.socialGrainActorProfileByDid; 833 + const avatar = profile?.avatar; 833 834 834 835 return { 835 836 did: viewer?.did || '', 836 837 handle: viewer?.handle || '', 837 838 displayName: profile?.displayName || '', 838 839 description: profile?.description || '', 839 - avatarUrl: profile?.avatar?.url || '' 840 + avatarUrl: avatar?.url || '', 841 + avatarBlob: avatar ? { 842 + $type: 'blob', 843 + ref: { $link: avatar.ref }, 844 + mimeType: avatar.mimeType, 845 + size: avatar.size 846 + } : null 840 847 }; 841 848 } 842 849 }