WIP PWA for Grain
0
fork

Configure Feed

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

fix: use authenticated client for getCurrentProfile to load avatar

+6 -6
+2 -1
src/components/pages/grain-edit-profile.js
··· 175 175 176 176 async #loadProfile() { 177 177 try { 178 - const profile = await grainApi.getCurrentProfile(); 178 + const client = auth.getClient(); 179 + const profile = await grainApi.getCurrentProfile(client); 179 180 this._originalProfile = profile; 180 181 this._displayName = profile.displayName; 181 182 this._description = profile.description;
+4 -5
src/services/grain-api.js
··· 813 813 }); 814 814 } 815 815 816 - async getCurrentProfile() { 817 - const query = ` 816 + async getCurrentProfile(client) { 817 + const result = await client.query(` 818 818 query { 819 819 viewer { 820 820 did ··· 826 826 } 827 827 } 828 828 } 829 - `; 829 + `); 830 830 831 - const response = await this.#execute(query, {}); 832 - const viewer = response.data?.viewer; 831 + const viewer = result.viewer; 833 832 const profile = viewer?.socialGrainActorProfileByDid; 834 833 835 834 return {