Merge pull request #417 from ONLYOFFICE/bugfix/profile-active-sessions

bugfix/profile-active-sessions
This commit is contained in:
Alexey Safronov 2024-05-21 13:10:59 +04:00 committed by GitHub
commit 3801069692
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 17 deletions

View File

@ -36,7 +36,6 @@ import TickSvgUrl from "PUBLIC_DIR/images/tick.svg?url";
const SessionsRow = (props) => {
const {
item,
standalone,
sectionWidth,
currentSession,
setPlatformModalData,
@ -88,19 +87,16 @@ const SessionsRow = (props) => {
ip={item.ip}
sectionWidth={sectionWidth}
showTickIcon={showTickIcon}
standalone={standalone}
/>
</Row>
);
};
export default inject(({ setup, settingsStore }) => {
const { standalone } = settingsStore;
export default inject(({ setup }) => {
const { currentSession, setLogoutDialogVisible, setPlatformModalData } =
setup;
return {
standalone,
currentSession,
setLogoutDialogVisible,
setPlatformModalData,

View File

@ -47,7 +47,6 @@ const StyledRowContent = styled(RowContent)`
const SessionsRowContent = ({
id,
standalone,
platform,
browser,
date,
@ -70,10 +69,11 @@ const SessionsRowContent = ({
<IconButton size={12} iconName={TickSvgUrl} color="#20D21F" />
)}
<Text truncate>{convertTime(date)}</Text>
{!standalone && (
{(country || city) && (
<Text truncate>
{country}
{` ${city}`}
{country && city && ", "}
{city}
</Text>
)}
<Text truncate containerWidth="160px">

View File

@ -82,7 +82,6 @@ const SessionsTableRow = (props) => {
const {
item,
hideColumns,
standalone,
currentSession,
setPlatformModalData,
setLogoutDialogVisible,
@ -125,15 +124,15 @@ const SessionsTableRow = (props) => {
<TableCell>
<Text className="session-info" truncate>
{!standalone ? (
{(country || city) && (
<>
{country}, {city}
{country}
{country && city && ", "}
{city}
<span className="divider"></span>
{ip}
</>
) : (
<>{ip}</>
)}
{ip}
</Text>
</TableCell>
@ -153,13 +152,11 @@ const SessionsTableRow = (props) => {
);
};
export default inject(({ setup, settingsStore }) => {
const { standalone } = settingsStore;
export default inject(({ setup }) => {
const { currentSession, setLogoutDialogVisible, setPlatformModalData } =
setup;
return {
standalone,
currentSession,
setLogoutDialogVisible,
setPlatformModalData,