WIP PWA for Grain
0
fork

Configure Feed

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

feat: add getCurrentProfile method to grain-api

+28
+28
src/services/grain-api.js
··· 812 812 ); 813 813 }); 814 814 } 815 + 816 + async getCurrentProfile() { 817 + const query = ` 818 + query { 819 + viewer { 820 + did 821 + handle 822 + socialGrainActorProfileByDid { 823 + displayName 824 + description 825 + avatar { url } 826 + } 827 + } 828 + } 829 + `; 830 + 831 + const response = await this.#execute(query, {}); 832 + const viewer = response.data?.viewer; 833 + const profile = viewer?.socialGrainActorProfileByDid; 834 + 835 + return { 836 + did: viewer?.did || '', 837 + handle: viewer?.handle || '', 838 + displayName: profile?.displayName || '', 839 + description: profile?.description || '', 840 + avatarUrl: profile?.avatar?.url || '' 841 + }; 842 + } 815 843 } 816 844 817 845 export const grainApi = new GrainApiService();