Skip to content

Commit

Permalink
fix(clientportal): update settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Anu-Ujin Bat-Ulzii authored and Anu-Ujin Bat-Ulzii committed May 25, 2023
1 parent ff71232 commit 3b4da72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion client-portal/modules/appContext.tsx
@@ -1,5 +1,6 @@
import {
Config,
IUser,
NotificationsCountQueryResponse,
NotificationsQueryResponse,
UserQueryResponse,
Expand All @@ -23,7 +24,7 @@ type Props = {
};

function AppProvider({ children }: Props) {
const [currentUser, setCurrentUser] = React.useState(null);
const [currentUser, setCurrentUser] = React.useState({} as IUser);
const [notificationsCount, setNotificationsCount] = React.useState(0);

const userQuery = useQuery<UserQueryResponse>(gql(queries.currentUser));
Expand Down
3 changes: 1 addition & 2 deletions client-portal/modules/user/components/Settings.tsx
Expand Up @@ -2,7 +2,6 @@ import { ControlLabel, FormGroup } from "../../common/form";
import { SettingsContent, SettingsTitle } from "../../styles/profile";

import Button from "../../common/Button";
import { FormWrapper } from "../../styles/main";
import { IUser } from "../../types";
import { ModalFooter } from "../../common/form/styles";
import React from "react";
Expand All @@ -13,7 +12,7 @@ type Props = {
onSave: (doc: { [key: string]: any }) => void;
};

function Settings({ currentUser, onSave }: Props) {
function Settings({ currentUser = {} as IUser, onSave }: Props) {
const notificationSettings = currentUser.notificationSettings || {
receiveByEmail: false,
receiveBySms: false,
Expand Down

0 comments on commit 3b4da72

Please sign in to comment.