浏览代码

Change announcements to be collapsed on page load in web UI (#12990)

master^2
Eugen Rochko 4 年前
committed by GitHub
父节点
当前提交
0fcc4b1c56
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 2 个文件被更改,包括 5 次插入4 次删除
  1. +1
    -1
      app/javascript/mastodon/features/getting_started/components/announcements.js
  2. +4
    -3
      app/javascript/mastodon/reducers/announcements.js

+ 1
- 1
app/javascript/mastodon/features/getting_started/components/announcements.js 查看文件

@@ -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')}


+ 4
- 3
app/javascript/mastodon/reducers/announcements.js 查看文件

@@ -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);


正在加载...
取消
保存