Fix: #241 リスト新着通知で、数日前の古い投稿についての通知が来る場合がある (#242)

* Fix: #241 リスト通知の重複についてとりあえずの対処

* Fix: 本家の通知バグ
This commit is contained in:
KMY(雪あすか) 2023-11-07 17:16:10 +09:00 committed by GitHub
parent 59f851d21a
commit d7f07ae80f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View file

@ -107,8 +107,8 @@ export function updateNotifications(notification, intlMessages, intlLocale) {
dispatch(importFetchedAccount(notification.report.target_account)); dispatch(importFetchedAccount(notification.report.target_account));
} }
dispatch(notificationsUpdate(notification, preferPendingItems, playSound && !filtered)); dispatch(notificationsUpdate({ notification }, preferPendingItems, playSound && !filtered));
fetchRelatedRelationships(dispatch, [notification]); fetchRelatedRelationships(dispatch, [notification]);
} else if (playSound && !filtered) { } else if (playSound && !filtered) {

View file

@ -368,7 +368,7 @@ class Notification extends ImmutablePureComponent {
return ( return (
<HotKeys handlers={this.getHandlers()}> <HotKeys handlers={this.getHandlers()}>
<div className={classNames('notification notification-list_status focusable', { unread })} tabIndex={0} aria-label={notificationForScreenReader(intl, intl.formatMessage(messages.listStatus, { name: notification.getIn(['account', 'acct']) }), notification.get('created_at'))}> <div className={classNames('notification notification-list_status focusable', { unread })} tabIndex={0} aria-label={notificationForScreenReader(intl, intl.formatMessage(messages.listStatus, { name: notification.getIn(['account', 'acct']), listName: notification.getIn(['list', 'title']) }), notification.get('created_at'))}>
<div className='notification__message'> <div className='notification__message'>
<Icon id='list-ul' icon={ListAltIcon} /> <Icon id='list-ul' icon={ListAltIcon} />

View file

@ -10,6 +10,7 @@ class FeedInsertWorker
@status = Status.find(status_id) @status = Status.find(status_id)
@options = options.symbolize_keys @options = options.symbolize_keys
@antenna = Antenna.find(@options[:antenna_id]) if @options[:antenna_id].present? @antenna = Antenna.find(@options[:antenna_id]) if @options[:antenna_id].present?
@pushed = false
case @type case @type
when :home, :tags when :home, :tags
@ -60,7 +61,7 @@ class FeedInsertWorker
end end
def notify_for_list? def notify_for_list?
return false unless @type == :list return false if @type != :list || update? || !@pushed
@list.notify? @list.notify?
end end
@ -69,9 +70,9 @@ class FeedInsertWorker
if @antenna.nil? || @antenna.insert_feeds if @antenna.nil? || @antenna.insert_feeds
case @type case @type
when :home, :tags when :home, :tags
FeedManager.instance.push_to_home(@follower, @status, update: update?) @pushed = FeedManager.instance.push_to_home(@follower, @status, update: update?)
when :list when :list
FeedManager.instance.push_to_list(@list, @status, update: update?) @pushed = FeedManager.instance.push_to_list(@list, @status, update: update?)
end end
end end