BackendUserInfo.ts (hoppscotch-2.0.0) | : | BackendUserInfo.ts (hoppscotch-2.1.0) | ||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
*/ | */ | |||
displayName: string | null | displayName: string | null | |||
/** | /** | |||
* Email of the user (or null if none available) | * Email of the user (or null if none available) | |||
*/ | */ | |||
email: string | null | email: string | null | |||
/** | /** | |||
* URL to the profile photo of the user (or null if none available) | * URL to the profile photo of the user (or null if none available) | |||
*/ | */ | |||
photoURL: string | null | photoURL: string | null | |||
/** | ||||
* Whether the user has access to Early Access features | ||||
*/ | ||||
eaInvited: boolean | ||||
} | } | |||
/** | /** | |||
* An observable subject onto the currently logged in user info (is null if not logged in) | * An observable subject onto the currently logged in user info (is null if not logged in) | |||
*/ | */ | |||
export const currentUserInfo$ = new BehaviorSubject<UserInfo | null>(null) | export const currentUserInfo$ = new BehaviorSubject<UserInfo | null>(null) | |||
/** | /** | |||
* Initializes the currenUserInfo$ view and sets up its update mechanism | * Initializes the currenUserInfo$ view and sets up its update mechanism | |||
*/ | */ | |||
skipping to change at line 68 | skipping to change at line 64 | |||
async function updateUserInfo() { | async function updateUserInfo() { | |||
try { | try { | |||
const { data } = await apolloClient.query({ | const { data } = await apolloClient.query({ | |||
query: gql` | query: gql` | |||
query GetUserInfo { | query GetUserInfo { | |||
me { | me { | |||
uid | uid | |||
displayName | displayName | |||
photoURL | photoURL | |||
eaInvited | ||||
} | } | |||
} | } | |||
`, | `, | |||
}) | }) | |||
currentUserInfo$.next({ | currentUserInfo$.next({ | |||
uid: data.me.uid, | uid: data.me.uid, | |||
displayName: data.me.displayName, | displayName: data.me.displayName, | |||
email: data.me.email, | email: data.me.email, | |||
photoURL: data.me.photoURL, | photoURL: data.me.photoURL, | |||
eaInvited: data.me.eaInvited, | ||||
}) | }) | |||
} catch (e) { | } catch (e) { | |||
currentUserInfo$.next(null) | currentUserInfo$.next(null) | |||
} | } | |||
} | } | |||
End of changes. 3 change blocks. | ||||
6 lines changed or deleted | 0 lines changed or added |