Merge branch 'fedibird' into 'develop'
Fedibird birthdays Closes #833 See merge request soapbox-pub/soapbox-fe!1054
This commit is contained in:
commit
07aaa427a6
|
@ -56,7 +56,7 @@ class Account extends ImmutablePureComponent {
|
||||||
|
|
||||||
if (!account) return null;
|
if (!account) return null;
|
||||||
|
|
||||||
const birthday = account.getIn(['pleroma', 'birthday']);
|
const birthday = account.get('birthday');
|
||||||
if (!birthday) return null;
|
if (!birthday) return null;
|
||||||
|
|
||||||
const formattedBirthday = intl.formatDate(birthday, { day: 'numeric', month: 'short', year: 'numeric' });
|
const formattedBirthday = intl.formatDate(birthday, { day: 'numeric', month: 'short', year: 'numeric' });
|
||||||
|
|
|
@ -114,7 +114,7 @@ class EditProfile extends ImmutablePureComponent {
|
||||||
const strangerNotifications = account.getIn(['pleroma', 'notification_settings', 'block_from_strangers']);
|
const strangerNotifications = account.getIn(['pleroma', 'notification_settings', 'block_from_strangers']);
|
||||||
const acceptsEmailList = account.getIn(['pleroma', 'accepts_email_list']);
|
const acceptsEmailList = account.getIn(['pleroma', 'accepts_email_list']);
|
||||||
const discoverable = account.getIn(['source', 'pleroma', 'discoverable']);
|
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 showBirthday = account.getIn(['source', 'pleroma', 'show_birthday']);
|
||||||
|
|
||||||
const initialState = account.withMutations(map => {
|
const initialState = account.withMutations(map => {
|
||||||
|
|
|
@ -85,7 +85,7 @@ class ProfileInfoPanel extends ImmutablePureComponent {
|
||||||
getBirthday = () => {
|
getBirthday = () => {
|
||||||
const { account, intl } = this.props;
|
const { account, intl } = this.props;
|
||||||
|
|
||||||
const birthday = account.getIn(['pleroma', 'birthday']);
|
const birthday = account.get('birthday');
|
||||||
if (!birthday) return null;
|
if (!birthday) return null;
|
||||||
|
|
||||||
const formattedBirthday = intl.formatDate(birthday, { timeZone: 'UTC', day: 'numeric', month: 'long', year: 'numeric' });
|
const formattedBirthday = intl.formatDate(birthday, { timeZone: 'UTC', day: 'numeric', month: 'long', year: 'numeric' });
|
||||||
|
|
|
@ -48,12 +48,19 @@ const normalizePleroma = account => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const normalizeAccount = (state, account) => {
|
const normalizeAccount = (state, account) => {
|
||||||
const normalized = fromJS(normalizePleroma(account)).deleteAll([
|
const normalized = fromJS(normalizePleroma(account)).withMutations(account => {
|
||||||
|
account.deleteAll([
|
||||||
'followers_count',
|
'followers_count',
|
||||||
'following_count',
|
'following_count',
|
||||||
'statuses_count',
|
'statuses_count',
|
||||||
'source',
|
'source',
|
||||||
]);
|
]);
|
||||||
|
account.set(
|
||||||
|
'birthday',
|
||||||
|
account.getIn(['pleroma', 'birthday'], account.getIn(['other_settings', 'birthday'])),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
return state.set(account.id, normalized);
|
return state.set(account.id, normalized);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue