diff --git a/app/assets/javascripts/discourse/widgets/header.js.es6 b/app/assets/javascripts/discourse/widgets/header.js.es6 index d1c25a411c4..131198ced3a 100644 --- a/app/assets/javascripts/discourse/widgets/header.js.es6 +++ b/app/assets/javascripts/discourse/widgets/header.js.es6 @@ -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;