Don't assign variable when not required to do so.

This commit is contained in:
Guo Xiang Tan 2017-02-28 14:14:57 +08:00
parent e6d75f6844
commit 54577db8a4

View File

@ -197,10 +197,9 @@ export default createWidget('header', {
if (state.searchContextType !== contextType) {
state.contextEnabled = undefined;
state.searchContextType = contextType;
}
state.searchContextType = contextType;
if (state.contextEnabled === undefined) {
if (forceContextEnabled.includes(contextType)) {
state.contextEnabled = true;