Fix Bug 65115

This commit is contained in:
Viktor Fomin 2023-11-15 12:59:48 +03:00
parent b6eea3fa9d
commit 063eced10f

View File

@ -8,10 +8,10 @@ import tryRedirectTo from "@docspace/common/utils/tryRedirectTo";
class ChangeEmail extends React.PureComponent { class ChangeEmail extends React.PureComponent {
componentDidMount() { componentDidMount() {
const { changeEmail, userId, isLoaded, linkData } = this.props; const { changeEmail, isLoaded, linkData } = this.props;
if (isLoaded) { if (isLoaded) {
const [email, key] = [linkData.email, linkData.confirmHeader]; const { email, uid, confirmHeader } = linkData;
changeEmail(userId, email, key) changeEmail(uid, email, confirmHeader)
.then((res) => { .then((res) => {
console.log("change client email success", res); console.log("change client email success", res);
tryRedirectTo( tryRedirectTo(
@ -45,10 +45,10 @@ class ChangeEmail extends React.PureComponent {
} }
componentDidUpdate() { componentDidUpdate() {
const { changeEmail, userId, isLoaded, linkData, defaultPage } = this.props; const { changeEmail, isLoaded, linkData, defaultPage } = this.props;
if (isLoaded) { if (isLoaded) {
const [email, key] = [linkData.email, linkData.confirmHeader]; const { email, uid, confirmHeader } = linkData;
changeEmail(userId, email, key) changeEmail(uid, email, confirmHeader)
.then((res) => { .then((res) => {
console.log("change client email success", res); console.log("change client email success", res);
tryRedirectTo( tryRedirectTo(
@ -82,11 +82,9 @@ const ChangeEmailForm = (props) => (
); );
export default inject(({ auth }) => { export default inject(({ auth }) => {
const { logout, userStore, settingsStore, isLoaded } = auth; const { userStore, settingsStore, isLoaded } = auth;
return { return {
isLoaded, isLoaded,
userId: userStore.user.id,
logout,
changeEmail: userStore.changeEmail, changeEmail: userStore.changeEmail,
defaultPage: settingsStore.defaultPage, defaultPage: settingsStore.defaultPage,
}; };