]> cat aescling's git repositories - mastodon.git/commitdiff
Rename variables to have semantic meanings in notifications reducer (#6890)
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Sat, 24 Mar 2018 12:36:44 +0000 (21:36 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 24 Mar 2018 12:36:44 +0000 (13:36 +0100)
app/javascript/mastodon/reducers/notifications.js

index 264db4f558f656c86a11b52c501551c9f445c9a2..06c36c89a6c94122c8cace316a9b4790642d006a 100644 (file)
@@ -49,11 +49,11 @@ const normalizeNotification = (state, notification) => {
 };
 
 const normalizeNotifications = (state, notifications, next) => {
-  let items    = ImmutableList();
+  let newItems    = ImmutableList();
   const loaded = state.get('loaded');
 
   notifications.forEach((n, i) => {
-    items = items.set(i, notificationToMap(n));
+    newItems = newItems.set(i, notificationToMap(n));
   });
 
   if (state.get('next') === null) {
@@ -61,7 +61,7 @@ const normalizeNotifications = (state, notifications, next) => {
   }
 
   return state
-    .update('items', list => loaded ? items.concat(list) : list.concat(items))
+    .update('items', oldItems => loaded ? newItems.concat(oldItems) : oldItems.concat(newItems))
     .set('loaded', true)
     .set('isLoading', false);
 };