Rewrote app to use hooks and fixed multiple re-renders.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
export default {
|
||||
currentUser: { email: null, displayName: null },
|
||||
__typename: "State",
|
||||
currentUser: null,
|
||||
selectedNavItem: "Home",
|
||||
recentItems: [],
|
||||
whiteBoardLeftSiderVisible: true
|
||||
|
||||
@@ -12,6 +12,10 @@ export const GET_CURRENT_USER = gql`
|
||||
{
|
||||
currentUser @client {
|
||||
email
|
||||
displayName
|
||||
token
|
||||
uid
|
||||
photoUrl
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -20,4 +24,4 @@ export const GET_WHITE_BOARD_LEFT_SIDER_VISIBLE = gql`
|
||||
{
|
||||
whiteBoardLeftSiderVisible @client
|
||||
}
|
||||
`;
|
||||
`;
|
||||
|
||||
@@ -20,11 +20,3 @@ export const GET_SELECTED_NAV_ITEM = gql`
|
||||
selectedNavItem @client
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
|
||||
// export const SET_CURRENT_USER = gql`
|
||||
// mutation SetCurrentUser($user User!){
|
||||
// setCurrentUser(currentUser: $user)
|
||||
// }
|
||||
// `;
|
||||
|
||||
@@ -6,7 +6,7 @@ export const UPSERT_USER = gql`
|
||||
objects: [{ email: $authEmail, authid: $authToken }]
|
||||
on_conflict: { constraint: users_pkey, update_columns: [authid] }
|
||||
) {
|
||||
data {
|
||||
returning {
|
||||
authid
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user