Don’t reload default project when id doesn’t change

Fixes the issue where the default project reloads when the locale changes.

Why is SET_PROJECT_ID getting dispatched on locale change?
This commit is contained in:
chrisgarrity committed 2018-10-30 10:09:07 -04:00
1 parent d4553f3809
commit 38218cb5ba
1 file changed
+4
+4
View File
@@ -172,6 +172,10 @@ const reducer = function (state, action) {
}
return state;
case SET_PROJECT_ID:
// if the projectId hasn't actually changed do nothing
if (state.projectId === action.projectId) {
return state;
}
// if setting the default project id, specifically fetch that project
if (action.projectId === defaultProjectId) {
return Object.assign({}, state, {