Browse Source

Merge branch 'master' into development

closed-social-glitch-2
Eugen Rochko 8 years ago
parent
commit
f91b6fa9e1
4 changed files with 9 additions and 3 deletions
  1. +2
    -2
      app/assets/javascripts/components/actions/notifications.jsx
  2. +2
    -1
      app/assets/javascripts/components/reducers/accounts.jsx
  3. +4
    -0
      app/models/favourite.rb
  4. +1
    -0
      app/models/status.rb

+ 2
- 2
app/assets/javascripts/components/actions/notifications.jsx View File

@ -76,7 +76,7 @@ export function refreshNotificationsSuccess(notifications, next) {
type: NOTIFICATIONS_REFRESH_SUCCESS,
notifications,
accounts: notifications.map(item => item.account),
statuses: notifications.map(item => item.status),
statuses: notifications.map(item => item.status).filter(status => !!status),
next
};
};
@ -120,7 +120,7 @@ export function expandNotificationsSuccess(notifications, next) {
type: NOTIFICATIONS_EXPAND_SUCCESS,
notifications,
accounts: notifications.map(item => item.account),
statuses: notifications.map(item => item.status),
statuses: notifications.map(item => item.status).filter(status => !!status),
next
};
};

+ 2
- 1
app/assets/javascripts/components/reducers/accounts.jsx View File

@ -78,9 +78,10 @@ export default function accounts(state = initialState, action) {
case FAVOURITES_FETCH_SUCCESS:
case COMPOSE_SUGGESTIONS_READY:
case SEARCH_SUGGESTIONS_READY:
return normalizeAccounts(state, action.accounts);
case NOTIFICATIONS_REFRESH_SUCCESS:
case NOTIFICATIONS_EXPAND_SUCCESS:
return normalizeAccounts(state, action.accounts);
return normalizeAccountsFromStatuses(normalizeAccounts(state, action.accounts), action.statuses);
case TIMELINE_REFRESH_SUCCESS:
case TIMELINE_EXPAND_SUCCESS:
case ACCOUNT_TIMELINE_FETCH_SUCCESS:

+ 4
- 0
app/models/favourite.rb View File

@ -28,4 +28,8 @@ class Favourite < ApplicationRecord
def target
thread
end
before_validation do
self.status = status.reblog if status.reblog?
end
end

+ 1
- 0
app/models/status.rb View File

@ -168,6 +168,7 @@ class Status < ApplicationRecord
before_validation do
text.strip!
self.reblog = reblog.reblog if reblog? && reblog.reblog?
self.in_reply_to_account_id = thread.account_id if reply?
self.visibility = :public if visibility.nil?
end

Loading…
Cancel
Save