Merge branch 'fedibird' into 'develop'

Fedibird birthdays

Closes #833

See merge request soapbox-pub/soapbox-fe!1054
improve-ci
Alex Gleason 2022-02-27 19:33:32 +00:00
commit 07aaa427a6
4 zmienionych plików z 16 dodań i 9 usunięć

Wyświetl plik

@ -56,7 +56,7 @@ class Account extends ImmutablePureComponent {
if (!account) return null;
const birthday = account.getIn(['pleroma', 'birthday']);
const birthday = account.get('birthday');
if (!birthday) return null;
const formattedBirthday = intl.formatDate(birthday, { day: 'numeric', month: 'short', year: 'numeric' });

Wyświetl plik

@ -114,7 +114,7 @@ class EditProfile extends ImmutablePureComponent {
const strangerNotifications = account.getIn(['pleroma', 'notification_settings', 'block_from_strangers']);
const acceptsEmailList = account.getIn(['pleroma', 'accepts_email_list']);
const discoverable = account.getIn(['source', 'pleroma', 'discoverable']);
const birthday = account.getIn(['pleroma', 'birthday']);
const birthday = account.get('birthday');
const showBirthday = account.getIn(['source', 'pleroma', 'show_birthday']);
const initialState = account.withMutations(map => {

Wyświetl plik

@ -85,7 +85,7 @@ class ProfileInfoPanel extends ImmutablePureComponent {
getBirthday = () => {
const { account, intl } = this.props;
const birthday = account.getIn(['pleroma', 'birthday']);
const birthday = account.get('birthday');
if (!birthday) return null;
const formattedBirthday = intl.formatDate(birthday, { timeZone: 'UTC', day: 'numeric', month: 'long', year: 'numeric' });

Wyświetl plik

@ -48,12 +48,19 @@ const normalizePleroma = account => {
};
const normalizeAccount = (state, account) => {
const normalized = fromJS(normalizePleroma(account)).deleteAll([
'followers_count',
'following_count',
'statuses_count',
'source',
]);
const normalized = fromJS(normalizePleroma(account)).withMutations(account => {
account.deleteAll([
'followers_count',
'following_count',
'statuses_count',
'source',
]);
account.set(
'birthday',
account.getIn(['pleroma', 'birthday'], account.getIn(['other_settings', 'birthday'])),
);
});
return state.set(account.id, normalized);
};