Faster preferences window
This commit is contained in:
parent
ac55b8d643
commit
91af0dad78
71 changed files with 3567 additions and 2093 deletions
25
ts/shims/dispatchItemsMiddleware.ts
Normal file
25
ts/shims/dispatchItemsMiddleware.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { Middleware } from 'redux';
|
||||
|
||||
import { COLORS_CHANGED, COLOR_SELECTED } from '../state/ducks/conversations';
|
||||
|
||||
export const dispatchItemsMiddleware: Middleware = ({
|
||||
getState,
|
||||
}) => next => action => {
|
||||
if (
|
||||
action.type === 'items/PUT' ||
|
||||
action.type === 'items/PUT_EXTERNAL' ||
|
||||
action.type === 'items/REMOVE' ||
|
||||
action.type === 'items/REMOVE_EXTERNAL' ||
|
||||
action.type === 'items/RESET' ||
|
||||
action.type === COLOR_SELECTED ||
|
||||
action.type === COLORS_CHANGED
|
||||
) {
|
||||
ipcRenderer.send('preferences-changed', getState().items);
|
||||
}
|
||||
|
||||
return next(action);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue