mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 05:52:49 +08:00
FIX: Bulk clear reminders when the reminder is expired (#27220)
This commit is contained in:
parent
caa29ec973
commit
76c56c8284
|
@ -65,6 +65,7 @@ export default DropdownSelectBoxComponent.extend({
|
|||
})
|
||||
.then(() => {
|
||||
this.router.refresh();
|
||||
this.bulkSelectHelper.clear();
|
||||
this.toasts.success({
|
||||
duration: 3000,
|
||||
data: { message: i18n("bookmarks.bulk.reminders_cleared") },
|
||||
|
@ -88,6 +89,7 @@ export default DropdownSelectBoxComponent.extend({
|
|||
})
|
||||
.then(() => {
|
||||
this.router.refresh();
|
||||
this.bulkSelectHelper.clear();
|
||||
this.toasts.success({
|
||||
duration: 3000,
|
||||
data: { message: i18n("bookmarks.bulk.delete_completed") },
|
||||
|
|
|
@ -120,7 +120,7 @@ class Bookmark < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def clear_reminder!
|
||||
update!(reminder_last_sent_at: Time.zone.now, reminder_set_at: nil)
|
||||
update!(reminder_last_sent_at: Time.zone.now, reminder_set_at: nil, reminder_at: nil)
|
||||
end
|
||||
|
||||
def reminder_at_in_zone(timezone)
|
||||
|
|
|
@ -44,7 +44,9 @@ RSpec.describe BookmarksBulkAction do
|
|||
expect do
|
||||
bba = BookmarksBulkAction.new(user, [bookmark_with_reminder.id], type: "clear_reminder")
|
||||
bba.perform!
|
||||
end.to change { Bookmark.find_by_id(bookmark_with_reminder.id).reminder_set_at }.to(nil)
|
||||
end.to change { Bookmark.find_by_id(bookmark_with_reminder.id).reminder_set_at }.to(
|
||||
nil,
|
||||
).and change { Bookmark.find_by_id(bookmark_with_reminder.id).reminder_at }.to(nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user