Bug 1624308 - Select top-level context if selected context is removed from the context list. r=jlast.

Differential Revision: https://phabricator.services.mozilla.com/D67865

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicolas Chevobbe 2020-03-23 20:34:52 +00:00
Родитель 702320920f
Коммит 09f8c97773
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -34,7 +34,13 @@ function threadsReducer(state = initialReducerState, action) {
const threads = state.threads.filter(
thread => thread._targetFront !== action.target
);
return { ...state, threads };
let { selected } = state;
if (selected._targetFront === action.target) {
selected = null;
}
return { ...state, threads, selected };
}
}
return state;