Add identity pickers on event creation & join
Also it now saves current actor in localStorage and initalizes it in Apollo Cache (just like user stuff). This allows not relying on loggedPerson query anymore. Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -12,6 +12,13 @@ export function buildCurrentUserResolver(cache: ApolloCache<NormalizedCacheObjec
|
||||
isLoggedIn: false,
|
||||
role: ICurrentUserRole.USER,
|
||||
},
|
||||
currentActor: {
|
||||
__typename: 'CurrentActor',
|
||||
id: null,
|
||||
preferredUsername: null,
|
||||
name: null,
|
||||
avatar: null,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -28,6 +35,19 @@ export function buildCurrentUserResolver(cache: ApolloCache<NormalizedCacheObjec
|
||||
},
|
||||
};
|
||||
|
||||
cache.writeData({ data });
|
||||
},
|
||||
updateCurrentActor: (_, { id, preferredUsername, avatar, name }, { cache }) => {
|
||||
const data = {
|
||||
currentActor: {
|
||||
id,
|
||||
preferredUsername,
|
||||
avatar,
|
||||
name,
|
||||
__typename: 'CurrentActor',
|
||||
},
|
||||
};
|
||||
|
||||
cache.writeData({ data });
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user