web: People: Fixed history go back

This commit is contained in:
Alexey Safronov 2019-09-27 15:38:27 +03:00
parent 857c486dc4
commit 35d19ddcf5
2 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import React from "react"; import React, { useCallback } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Text, IconButton, ContextMenuButton, toastr } from "asc-web-components"; import { Text, IconButton, ContextMenuButton, toastr } from "asc-web-components";
import { withRouter } from "react-router"; import { withRouter } from "react-router";
@ -174,6 +174,10 @@ const SectionHeaderContent = props => {
const { t } = useTranslation(); const { t } = useTranslation();
const contextOptions = () => getUserContextOptions(profile, viewer, t); const contextOptions = () => getUserContextOptions(profile, viewer, t);
const onClick = useCallback(() => {
history.goBack();
}, [history]);
return ( return (
<div style={wrapperStyle}> <div style={wrapperStyle}>
<div style={{ width: "16px" }}> <div style={{ width: "16px" }}>
@ -181,7 +185,7 @@ const SectionHeaderContent = props => {
iconName={"ArrowPathIcon"} iconName={"ArrowPathIcon"}
color="#A3A9AE" color="#A3A9AE"
size="16" size="16"
onClick={() => history.push(settings.homepage)} onClick={onClick}
/> />
</div> </div>
<Text.ContentHeader truncate={true} style={textStyle}> <Text.ContentHeader truncate={true} style={textStyle}>

View File

@ -29,8 +29,8 @@ const SectionHeaderContent = (props) => {
: ""; : "";
const onClick = useCallback(() => { const onClick = useCallback(() => {
history.push(settings.homepage) history.goBack();
}, [history, settings]); }, [history]);
return ( return (
<Wrapper> <Wrapper>