Update client dependencies
This commit is contained in:
parent
20c3855ced
commit
19bcc51eb4
13 changed files with 2973 additions and 1741 deletions
|
@ -1,7 +1,7 @@
|
|||
import debounce from 'lodash/debounce';
|
||||
|
||||
const debounceKey = action => {
|
||||
const key = action.socket.debounce.key;
|
||||
const { key } = action.socket.debounce;
|
||||
if (key) {
|
||||
return `${action.type} ${key}`;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import { setCharWidth } from 'state/app';
|
|||
import { stringWidth } from 'util';
|
||||
|
||||
export default function fonts({ store }) {
|
||||
let charWidth = localStorage.charWidth;
|
||||
let { charWidth } = localStorage;
|
||||
if (charWidth) {
|
||||
store.dispatch(setCharWidth(parseFloat(charWidth)));
|
||||
}
|
||||
|
|
|
@ -3,9 +3,10 @@ import debounce from 'lodash/debounce';
|
|||
import { getSelectedTab } from 'state/tab';
|
||||
import { observe } from 'util/observe';
|
||||
|
||||
const saveTab = debounce(tab =>
|
||||
Cookie.set('tab', tab.toString(), { expires: 30 })
|
||||
, 1000);
|
||||
const saveTab = debounce(
|
||||
tab => Cookie.set('tab', tab.toString(), { expires: 30 }),
|
||||
1000
|
||||
);
|
||||
|
||||
export default function storage({ store }) {
|
||||
observe(store, getSelectedTab, tab => {
|
||||
|
|
|
@ -15,7 +15,7 @@ const modePrefixes = [
|
|||
{ mode: 'a', prefix: '&' }, // Admin
|
||||
{ mode: 'o', prefix: '@' }, // Op
|
||||
{ mode: 'h', prefix: '%' }, // Halfop
|
||||
{ mode: 'v', prefix: '+' } // Voice
|
||||
{ mode: 'v', prefix: '+' } // Voice
|
||||
];
|
||||
|
||||
function updateRenderName(user) {
|
||||
|
@ -41,7 +41,7 @@ function loadUser(nick) {
|
|||
|
||||
for (let i = 0; i < modePrefixes.length; i++) {
|
||||
if (nick[0] === modePrefixes[i].prefix) {
|
||||
mode = modePrefixes[i].mode;
|
||||
({ mode } = modePrefixes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ function compareUsers(a, b) {
|
|||
b = b.renderName.toLowerCase();
|
||||
|
||||
for (let i = 0; i < modePrefixes.length; i++) {
|
||||
const prefix = modePrefixes[i].prefix;
|
||||
const { prefix } = modePrefixes[i];
|
||||
|
||||
if (a[0] === prefix && b[0] !== prefix) {
|
||||
return -1;
|
||||
|
@ -165,7 +165,7 @@ export default createReducer(Map(), {
|
|||
}
|
||||
|
||||
return users.update(i, u => {
|
||||
let mode = u.mode;
|
||||
let { mode } = u;
|
||||
let j = remove.length;
|
||||
while (j--) {
|
||||
mode = mode.replace(remove[j], '');
|
||||
|
|
|
@ -101,7 +101,7 @@ function initMessage(message, tab, state) {
|
|||
message.content = message.content.replace(/\s\s+/g, ' ');
|
||||
|
||||
if (message.content.indexOf('\x01ACTION') === 0) {
|
||||
const from = message.from;
|
||||
const { from } = message;
|
||||
message.from = null;
|
||||
message.type = 'action';
|
||||
message.content = from + message.content.slice(7, -1);
|
||||
|
|
|
@ -76,7 +76,7 @@ export function select(server, name, doReplace) {
|
|||
export function updateSelection() {
|
||||
return (dispatch, getState) => {
|
||||
const state = getState();
|
||||
const history = state.tab.history;
|
||||
const { history } = state.tab;
|
||||
const { servers } = state;
|
||||
const { server } = state.tab.selected;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue