diff --git a/app/soapbox/features/birthdays/account.js b/app/soapbox/features/birthdays/account.js index d0961d0ae..e79273f89 100644 --- a/app/soapbox/features/birthdays/account.js +++ b/app/soapbox/features/birthdays/account.js @@ -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' }); diff --git a/app/soapbox/features/edit_profile/index.js b/app/soapbox/features/edit_profile/index.js index ad1197555..5205f4eb6 100644 --- a/app/soapbox/features/edit_profile/index.js +++ b/app/soapbox/features/edit_profile/index.js @@ -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 => { diff --git a/app/soapbox/features/ui/components/profile_info_panel.js b/app/soapbox/features/ui/components/profile_info_panel.js index 35d12a627..bb0db2677 100644 --- a/app/soapbox/features/ui/components/profile_info_panel.js +++ b/app/soapbox/features/ui/components/profile_info_panel.js @@ -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' }); diff --git a/app/soapbox/reducers/accounts.js b/app/soapbox/reducers/accounts.js index c8b52dd37..4ccb82856 100644 --- a/app/soapbox/reducers/accounts.js +++ b/app/soapbox/reducers/accounts.js @@ -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); };