0
0
Fork 0

Fix unnecessary re-rendering of various components when typing in web UI (#15286)

This commit is contained in:
Eugen Rochko 2020-12-07 19:36:36 +01:00 committed by GitHub
parent 48bef17cc9
commit 9620ee90be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 43 additions and 23 deletions

View file

@ -1,5 +1,5 @@
import { createSelector } from 'reselect';
import { List as ImmutableList, is } from 'immutable';
import { List as ImmutableList, Map as ImmutableMap, is } from 'immutable';
import { me } from '../initial_state';
const getAccountBase = (state, id) => state.getIn(['accounts', id], null);
@ -121,6 +121,16 @@ export const makeGetStatus = () => {
);
};
export const makeGetPictureInPicture = () => {
return createSelector([
(state, { id }) => state.get('picture_in_picture').statusId === id,
(state) => state.getIn(['meta', 'layout']) !== 'mobile',
], (inUse, available) => ImmutableMap({
inUse: inUse && available,
available,
}));
};
const getAlertsBase = state => state.get('alerts');
export const getAlerts = createSelector([getAlertsBase], (base) => {