Skip to content

Commit 6bcdebf

Browse files
committed
update UserState in root redux to include User
1 parent 3533425 commit 6bcdebf

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

client/modules/User/reducers.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ export type UserAction = {
88
type: any;
99
};
1010

11-
export const user = (state = { authenticated: false }, action: UserAction) => {
11+
export const user = (
12+
state: Partial<PublicUser> & {
13+
authenticated: boolean;
14+
} = {
15+
authenticated: false
16+
},
17+
action: UserAction
18+
) => {
1219
switch (action.type) {
1320
case ActionTypes.AUTH_USER:
1421
return {

server/types/user.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface IUser extends VirtualId, MongooseTimestamps {
2222
tokens: { kind: string }[];
2323
apiKeys: Types.DocumentArray<ApiKeyDocument>;
2424
preferences: UserPreferences;
25-
totalSize: number;
25+
totalSize?: number;
2626
cookieConsent: CookieConsentOptions;
2727
banned: boolean;
2828
lastLoginTimestamp?: Date;
@@ -44,6 +44,7 @@ export interface PublicUser
4444
| 'github'
4545
| 'google'
4646
| 'cookieConsent'
47+
| 'totalSize'
4748
> {
4849
/** Can contain either raw ApiKeyDocuments (server side) or SanitisedApiKeys (client side) */
4950
apiKeys: SanitisedApiKey[];

0 commit comments

Comments
 (0)