]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Change announcements to be collapsed on page load in web UI
authorEugen Rochko <eugen@zeonfederated.com>
Tue, 28 Jan 2020 01:20:47 +0000 (02:20 +0100)
committerThibaut Girka <thib@sitedethib.com>
Tue, 28 Jan 2020 18:17:06 +0000 (19:17 +0100)
Port 0fcc4b1c566e4365e07ce5a1c87743db76c07fe6 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
app/javascript/flavours/glitch/features/getting_started/components/announcements.js
app/javascript/flavours/glitch/reducers/announcements.js

index b56d566067db7f43b97dff01edb5c7f8671bfea1..4eeac8560ea10fe572bf7e755dbb38eda2e3a62b 100644 (file)
@@ -376,7 +376,7 @@ class Announcements extends ImmutablePureComponent {
         <img className='announcements__mastodon' alt='' draggable='false' src={mascot || elephantUIPlane} />
 
         <div className='announcements__container'>
-          <ReactSwipeableViews animateHeight index={index} onChangeIndex={this.handleChangeIndex}>
+          <ReactSwipeableViews animateHeight={!reduceMotion} adjustHeight={reduceMotion} index={index} onChangeIndex={this.handleChangeIndex}>
             {announcements.map(announcement => (
               <Announcement
                 key={announcement.get('id')}
index 3215c1c2dcc09c1f8adc501583b81895a991b848..1653318ce29962fa869b09515d11a413ad3b8343 100644 (file)
@@ -16,7 +16,7 @@ import { Map as ImmutableMap, List as ImmutableList, Set as ImmutableSet, fromJS
 const initialState = ImmutableMap({
   items: ImmutableList(),
   isLoading: false,
-  show: true,
+  show: false,
   unread: ImmutableSet(),
 });
 
@@ -84,10 +84,11 @@ export default function announcementsReducer(state = initialState, action) {
       const items = fromJS(action.announcements);
 
       map.set('unread', ImmutableSet());
-      map.set('items', items);
-      map.set('isLoading', false);
 
       addUnread(map, items);
+
+      map.set('items', items);
+      map.set('isLoading', false);
     });
   case ANNOUNCEMENTS_FETCH_FAIL:
     return state.set('isLoading', false);