From 38218cb5ba9f952e3bbf1ca70722bd8536be46fd Mon Sep 17 00:00:00 2001
From: chrisgarrity <chrisg@media.mit.edu>
Date: Tue, 30 Oct 2018 10:09:07 -0400
Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20reload=20default=20project=20wh?=
 =?UTF-8?q?en=20id=20doesn=E2=80=99t=20change?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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

Why is SET_PROJECT_ID getting dispatched on locale change?
---
 src/reducers/project-state.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/reducers/project-state.js b/src/reducers/project-state.js
index 734a05b13..f32800711 100644
--- a/src/reducers/project-state.js
+++ b/src/reducers/project-state.js
@@ -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, {
-- 
GitLab