mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-06-01 01:56:20 +00:00
Ensured mercure updates are not set even if supported, when they have been disabled
This commit is contained in:
@@ -9,6 +9,7 @@ import SortingDropdown from '../utils/SortingDropdown';
|
||||
import { determineOrderDir } from '../utils/utils';
|
||||
import { MercureInfoType } from '../mercure/reducers/mercureInfo';
|
||||
import { bindToMercureTopic } from '../mercure/helpers';
|
||||
import { RealTimeUpdatesType } from '../settings/reducers/realTimeUpdates';
|
||||
import { shortUrlType } from './reducers/shortUrlsList';
|
||||
import { shortUrlsListParamsType } from './reducers/shortUrlsListParams';
|
||||
import './ShortUrlsList.scss';
|
||||
@@ -33,6 +34,7 @@ const propTypes = {
|
||||
createNewVisit: PropTypes.func,
|
||||
loadMercureInfo: PropTypes.func,
|
||||
mercureInfo: MercureInfoType,
|
||||
realTimeUpdates: RealTimeUpdatesType,
|
||||
};
|
||||
|
||||
// FIXME Replace with typescript: (ShortUrlsRow component)
|
||||
@@ -50,6 +52,7 @@ const ShortUrlsList = (ShortUrlsRow) => {
|
||||
createNewVisit,
|
||||
loadMercureInfo,
|
||||
mercureInfo,
|
||||
realTimeUpdates,
|
||||
}) => {
|
||||
const { orderBy } = shortUrlsListParams;
|
||||
const [ order, setOrder ] = useState({
|
||||
@@ -117,7 +120,7 @@ const ShortUrlsList = (ShortUrlsRow) => {
|
||||
return resetShortUrlParams;
|
||||
}, []);
|
||||
useEffect(
|
||||
bindToMercureTopic(mercureInfo, 'https://shlink.io/new-visit', createNewVisit, loadMercureInfo),
|
||||
bindToMercureTopic(mercureInfo, realTimeUpdates, 'https://shlink.io/new-visit', createNewVisit, loadMercureInfo),
|
||||
[ mercureInfo ]
|
||||
);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ const provideServices = (bottle, connect) => {
|
||||
|
||||
bottle.serviceFactory('ShortUrlsList', ShortUrlsList, 'ShortUrlsRow');
|
||||
bottle.decorator('ShortUrlsList', connect(
|
||||
[ 'selectedServer', 'shortUrlsListParams', 'mercureInfo' ],
|
||||
[ 'selectedServer', 'shortUrlsListParams', 'mercureInfo', 'realTimeUpdates' ],
|
||||
[ 'listShortUrls', 'resetShortUrlParams', 'createNewVisit', 'loadMercureInfo' ]
|
||||
));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user