You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
Performance: suppresses redundant SideBar re-rendering on state.tags (#6451)
This commit is contained in:
committed by
GitHub
parent
fb9e78d6c1
commit
c320d2364e
@@ -1,4 +1,4 @@
|
||||
import produce, { Draft } from 'immer';
|
||||
import produce, { Draft, original } from 'immer';
|
||||
import pluginServiceReducer, { stateRootKey as pluginServiceStateRootKey, defaultState as pluginServiceDefaultState, State as PluginServiceState } from './services/plugins/reducer';
|
||||
import shareServiceReducer, { stateRootKey as shareServiceStateRootKey, defaultState as shareServiceDefaultState, State as ShareServiceState } from './services/share/reducer';
|
||||
import Note from './models/Note';
|
||||
@@ -7,6 +7,7 @@ import BaseModel from './BaseModel';
|
||||
import { Store } from 'redux';
|
||||
import { ProfileConfig } from './services/profileConfig/types';
|
||||
import * as ArrayUtils from './ArrayUtils';
|
||||
const fastDeepEqual = require('fast-deep-equal');
|
||||
const { ALL_NOTES_FILTER_ID } = require('./reserved-ids');
|
||||
const { createSelectorCreator, defaultMemoize } = require('reselect');
|
||||
const { createCachedSelector } = require('re-reselect');
|
||||
@@ -924,7 +925,9 @@ const reducer = produce((draft: Draft<State> = defaultState, action: any) => {
|
||||
break;
|
||||
|
||||
case 'TAG_UPDATE_ALL':
|
||||
draft.tags = action.items;
|
||||
if (!fastDeepEqual(original(draft.tags), action.items)) {
|
||||
draft.tags = action.items;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'TAG_SELECT':
|
||||
|
||||
Reference in New Issue
Block a user