Update client dependencies
This commit is contained in:
parent
1794e2680a
commit
508a41ee45
26 changed files with 4998 additions and 5245 deletions
|
@ -66,9 +66,6 @@ export default function withModal({ name, ...modalProps }) {
|
|||
return actions;
|
||||
};
|
||||
|
||||
return connect(
|
||||
mapState,
|
||||
mapDispatch
|
||||
)(ReduxModal);
|
||||
return connect(mapState, mapDispatch)(ReduxModal);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -23,7 +23,4 @@ const mapState = createStructuredSelector({
|
|||
|
||||
const mapDispatch = { push, select, hideMenu, openModal };
|
||||
|
||||
export default connect(
|
||||
mapState,
|
||||
mapDispatch
|
||||
)(App);
|
||||
export default connect(mapState, mapDispatch)(App);
|
||||
|
|
|
@ -85,7 +85,4 @@ const mapDispatch = dispatch => ({
|
|||
)
|
||||
});
|
||||
|
||||
export default connect(
|
||||
mapState,
|
||||
mapDispatch
|
||||
)(Chat);
|
||||
export default connect(mapState, mapDispatch)(Chat);
|
||||
|
|
|
@ -17,7 +17,4 @@ const mapDispatch = {
|
|||
select
|
||||
};
|
||||
|
||||
export default connect(
|
||||
mapState,
|
||||
mapDispatch
|
||||
)(Connect);
|
||||
export default connect(mapState, mapDispatch)(Connect);
|
||||
|
|
|
@ -6,7 +6,4 @@ const mapDispatch = {
|
|||
onClick: toggleMenu
|
||||
};
|
||||
|
||||
export default connect(
|
||||
null,
|
||||
mapDispatch
|
||||
)(Navicon);
|
||||
export default connect(null, mapDispatch)(Navicon);
|
||||
|
|
|
@ -24,7 +24,4 @@ const mapDispatch = {
|
|||
onInstall: () => appSet('installable', null)
|
||||
};
|
||||
|
||||
export default connect(
|
||||
mapState,
|
||||
mapDispatch
|
||||
)(Settings);
|
||||
export default connect(mapState, mapDispatch)(Settings);
|
||||
|
|
|
@ -81,7 +81,12 @@ export default function handleSocket({
|
|||
},
|
||||
|
||||
motd({ content, server }) {
|
||||
dispatch(addMessages(content.map(line => ({ content: line })), server));
|
||||
dispatch(
|
||||
addMessages(
|
||||
content.map(line => ({ content: line })),
|
||||
server
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
whois(data) {
|
||||
|
|
|
@ -82,7 +82,10 @@ describe('message reducer', () => {
|
|||
server: 'srv',
|
||||
tab: '#chan1',
|
||||
prepend: true,
|
||||
messages: [{ id: 1, date: new Date() }, { id: 2, date: new Date() }]
|
||||
messages: [
|
||||
{ id: 1, date: new Date() },
|
||||
{ id: 2, date: new Date() }
|
||||
]
|
||||
});
|
||||
|
||||
expect(state).toMatchObject({
|
||||
|
|
|
@ -91,18 +91,14 @@ export function compareUsers(a, b) {
|
|||
|
||||
export const getChannels = state => state.channels;
|
||||
|
||||
export const getSortedChannels = createSelector(
|
||||
getChannels,
|
||||
channels =>
|
||||
sortBy(
|
||||
Object.keys(channels).map(server => ({
|
||||
address: server,
|
||||
channels: sortBy(channels[server], channel =>
|
||||
channel.name.toLowerCase()
|
||||
)
|
||||
})),
|
||||
server => server.address.toLowerCase()
|
||||
)
|
||||
export const getSortedChannels = createSelector(getChannels, channels =>
|
||||
sortBy(
|
||||
Object.keys(channels).map(server => ({
|
||||
address: server,
|
||||
channels: sortBy(channels[server], channel => channel.name.toLowerCase())
|
||||
})),
|
||||
server => server.address.toLowerCase()
|
||||
)
|
||||
);
|
||||
|
||||
export const getSelectedChannel = createSelector(
|
||||
|
|
|
@ -4,19 +4,16 @@ import * as actions from './actions';
|
|||
|
||||
export const getModals = state => state.modals;
|
||||
|
||||
export const getHasOpenModals = createSelector(
|
||||
getModals,
|
||||
modals => {
|
||||
const keys = Object.keys(modals);
|
||||
export const getHasOpenModals = createSelector(getModals, modals => {
|
||||
const keys = Object.keys(modals);
|
||||
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
if (modals[keys[i]].isOpen) {
|
||||
return true;
|
||||
}
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
if (modals[keys[i]].isOpen) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
return false;
|
||||
});
|
||||
|
||||
export default createReducer(
|
||||
{},
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
workbox.core.skipWaiting();
|
||||
workbox.core.clientsClaim();
|
||||
import { skipWaiting, clientsClaim } from 'workbox-core';
|
||||
import { precacheAndRoute, createHandlerBoundToURL } from 'workbox-precaching';
|
||||
import { NavigationRoute, registerRoute } from 'workbox-routing';
|
||||
|
||||
workbox.precaching.precacheAndRoute(self.__precacheManifest, {
|
||||
skipWaiting();
|
||||
clientsClaim();
|
||||
|
||||
precacheAndRoute(self.__WB_MANIFEST, {
|
||||
ignoreUrlParametersMatching: [/.*/]
|
||||
});
|
||||
|
||||
const handler = createHandlerBoundToURL('/');
|
||||
registerRoute(new NavigationRoute(handler));
|
||||
|
|
|
@ -3,11 +3,6 @@ import { connect } from 'react-redux';
|
|||
const strictEqual = (a, b) => a === b;
|
||||
|
||||
export default (mapState, mapDispatch) =>
|
||||
connect(
|
||||
mapState,
|
||||
mapDispatch,
|
||||
null,
|
||||
{
|
||||
areStatePropsEqual: strictEqual
|
||||
}
|
||||
);
|
||||
connect(mapState, mapDispatch, null, {
|
||||
areStatePropsEqual: strictEqual
|
||||
});
|
||||
|
|
|
@ -8,10 +8,7 @@ export function normalizeChannel(channel) {
|
|||
return channel;
|
||||
}
|
||||
|
||||
return channel
|
||||
.split('#')
|
||||
.join('')
|
||||
.toLowerCase();
|
||||
return channel.split('#').join('').toLowerCase();
|
||||
}
|
||||
|
||||
export function isChannel(name) {
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import createHistory from 'history/createBrowserHistory';
|
||||
import history from 'history/browser';
|
||||
import UrlPattern from 'url-pattern';
|
||||
|
||||
const history = createHistory();
|
||||
|
||||
export const LOCATION_CHANGED = 'ROUTER_LOCATION_CHANGED';
|
||||
export const PUSH = 'ROUTER_PUSH';
|
||||
export const REPLACE = 'ROUTER_REPLACE';
|
||||
|
@ -97,7 +95,7 @@ export default function initRouter(routes, store) {
|
|||
matched = { location: {} };
|
||||
}
|
||||
|
||||
history.listen(location => {
|
||||
history.listen(({ location }) => {
|
||||
const nextMatch = match(patterns, location);
|
||||
if (
|
||||
nextMatch &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue