From 26095ff36e509900cbd15e1ec50a5ebb43825474 Mon Sep 17 00:00:00 2001 From: Allen Gilliland <agilliland@gmail.com> Date: Wed, 9 Sep 2015 16:26:14 -0700 Subject: [PATCH] a little more work to get color assignment working in the case where we have more users than colors. --- .../frontend_client/app/home/components/Activity.react.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/resources/frontend_client/app/home/components/Activity.react.js b/resources/frontend_client/app/home/components/Activity.react.js index d5db74d2640..5de0a4ab1d3 100644 --- a/resources/frontend_client/app/home/components/Activity.react.js +++ b/resources/frontend_client/app/home/components/Activity.react.js @@ -53,9 +53,16 @@ export default class Activity extends Component { // assign the user a color if (item.user_id === user.id) { userColors[item.user_id] = 0; + } else if (item.user_id === null) { + // just skip this scenario, we handle this differently } else { userColors[item.user_id] = colors[currColor]; currColor++; + + // if we hit the end of the colors list then just go back to the beginning again + if (currColor >= colors.length) { + currColor = 0; + } } } } -- GitLab