mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-15 12:03:46 +00:00
Added token expired handling to mercure binding
This commit is contained in:
@@ -31,6 +31,7 @@ const propTypes = {
|
||||
shortUrlsList: PropTypes.arrayOf(shortUrlType),
|
||||
selectedServer: serverType,
|
||||
createNewVisit: PropTypes.func,
|
||||
loadMercureInfo: PropTypes.func,
|
||||
mercureInfo: MercureInfoType,
|
||||
};
|
||||
|
||||
@@ -47,6 +48,7 @@ const ShortUrlsList = (ShortUrlsRow) => {
|
||||
shortUrlsList,
|
||||
selectedServer,
|
||||
createNewVisit,
|
||||
loadMercureInfo,
|
||||
mercureInfo,
|
||||
}) => {
|
||||
const { orderBy } = shortUrlsListParams;
|
||||
@@ -114,7 +116,10 @@ const ShortUrlsList = (ShortUrlsRow) => {
|
||||
|
||||
return resetShortUrlParams;
|
||||
}, []);
|
||||
useEffect(bindToMercureTopic(mercureInfo, 'https://shlink.io/new-visit', createNewVisit), [ mercureInfo ]);
|
||||
useEffect(
|
||||
bindToMercureTopic(mercureInfo, 'https://shlink.io/new-visit', createNewVisit, loadMercureInfo),
|
||||
[ mercureInfo ]
|
||||
);
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
||||
@@ -32,7 +32,7 @@ const provideServices = (bottle, connect) => {
|
||||
bottle.serviceFactory('ShortUrlsList', ShortUrlsList, 'ShortUrlsRow');
|
||||
bottle.decorator('ShortUrlsList', connect(
|
||||
[ 'selectedServer', 'shortUrlsListParams', 'mercureInfo' ],
|
||||
[ 'listShortUrls', 'resetShortUrlParams', 'createNewVisit' ]
|
||||
[ 'listShortUrls', 'resetShortUrlParams', 'createNewVisit', 'loadMercureInfo' ]
|
||||
));
|
||||
|
||||
bottle.serviceFactory('ShortUrlsRow', ShortUrlsRow, 'ShortUrlsRowMenu', 'ColorGenerator', 'useStateFlagTimeout');
|
||||
|
||||
Reference in New Issue
Block a user