Skip to content

Commit ad1732d

Browse files
authored
Merge pull request #504 from HSLdevcom/DT-6896
DT-6896 Fix showing login text in services that don't have login
2 parents 4fb01c1 + 720ade6 commit ad1732d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/ui/MonitorOverlay.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { FC, useContext, useEffect, useState } from 'react';
22
import { Link } from 'react-router-dom';
33
import cx from 'classnames';
44
import { useTranslation } from 'react-i18next';
5-
import { MonitorContext, UserContext } from '../contexts';
5+
import { ConfigContext, MonitorContext, UserContext } from '../contexts';
66
import monitorAPI from '../api';
77
import Loading from './Loading';
88

@@ -38,16 +38,20 @@ const MonitorOverlay: FC<IProps> = ({
3838
}
3939
}, []);
4040
const { pathname, href } = window.location;
41+
const config = useContext(ConfigContext);
4142
if (createNew) {
4243
to = '/createview';
4344
} else {
4445
if (!user?.sub) {
4546
if (href.indexOf('cont=') !== -1) {
4647
to = '/createview';
4748
search = window.location.search;
48-
} else {
49+
} else if (config.login.inUse) {
4950
to = '/';
5051
text = t('login');
52+
} else {
53+
to = '/createview';
54+
text = t('quickDisplayCreate');
5155
}
5256
} else {
5357
// user is logged in

0 commit comments

Comments
 (0)