mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-05-31 01:26:16 +00:00
Move settings from store to another context
This commit is contained in:
@@ -66,12 +66,14 @@ export const selectServerListener = (
|
||||
) => {
|
||||
const listener = createListenerMiddleware();
|
||||
|
||||
listener.startListening({
|
||||
actionCreator: selectServerThunk.fulfilled,
|
||||
effect: ({ payload }, { dispatch }) => {
|
||||
isReachableServer(payload) && dispatch(loadMercureInfo());
|
||||
},
|
||||
});
|
||||
// TODO Find a way for the mercure info to be re-loaded when server changes, without leaking mercure implementation
|
||||
// details
|
||||
// listener.startListening({
|
||||
// actionCreator: selectServerThunk.fulfilled,
|
||||
// effect: ({ payload }, { dispatch }) => {
|
||||
// isReachableServer(payload) && dispatch(loadMercureInfo());
|
||||
// },
|
||||
// });
|
||||
|
||||
return listener;
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type Bottle from 'bottlejs';
|
||||
import { prop } from 'ramda';
|
||||
import type { ConnectDecorator } from '../../container/types';
|
||||
import { Overview } from '../../shlink-web-component/overview/Overview';
|
||||
import { CreateServer } from '../CreateServer';
|
||||
import { DeleteServerButton } from '../DeleteServerButton';
|
||||
import { DeleteServerModal } from '../DeleteServerModal';
|
||||
@@ -63,12 +62,6 @@ export const provideServices = (bottle: Bottle, connect: ConnectDecorator) => {
|
||||
bottle.serviceFactory('ServerError', ServerError, 'DeleteServerButton');
|
||||
bottle.decorator('ServerError', connect(['servers', 'selectedServer']));
|
||||
|
||||
bottle.serviceFactory('Overview', Overview, 'ShortUrlsTable', 'CreateShortUrl');
|
||||
bottle.decorator('Overview', connect(
|
||||
['shortUrlsList', 'tagsList', 'selectedServer', 'mercureInfo', 'visitsOverview', 'settings'],
|
||||
['listShortUrls', 'listTags', 'createNewVisits', 'loadMercureInfo', 'loadVisitsOverview'],
|
||||
));
|
||||
|
||||
// Services
|
||||
bottle.constant('fileReaderFactory', () => new FileReader());
|
||||
bottle.service('ServersImporter', ServersImporter, 'csvToJson', 'fileReaderFactory');
|
||||
|
||||
Reference in New Issue
Block a user