We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e706aec + 213432f commit f962dd6Copy full SHA for f962dd6
1 file changed
packages/fxa-settings/src/models/Session.ts
@@ -69,21 +69,22 @@ export class Session implements SessionData {
69
}
70
71
72
- private get data() {
73
- const { session } = this.apolloClient.cache.readQuery<{
+ private get data(): Session | undefined {
+ const result = this.apolloClient.cache.readQuery<{
74
session: Session;
75
}>({
76
query: GET_SESSION_VERIFIED,
77
- })!;
78
- return session;
+ });
+
79
+ return result?.session;
80
81
82
get token(): string {
- return this.data.token;
83
+ return this.data?.token || '';
84
85
86
get verified(): boolean {
- return this.data.verified;
87
+ return this.data?.verified || false;
88
89
90
// TODO: Use GQL verifyCode instead of authClient
0 commit comments