mirror of
https://github.com/discourse/discourse.git
synced 2025-03-15 02:35:29 +08:00
FIX: don't send multiple requests when changing category notification (#6435)
This commit is contained in:
parent
e2770bc1c4
commit
1add11d8c9
@ -11,5 +11,7 @@ export default NotificationOptionsComponent.extend({
|
||||
|
||||
mutateValue(value) {
|
||||
this.get("category").setNotification(value);
|
||||
}
|
||||
},
|
||||
|
||||
deselect() {}
|
||||
});
|
||||
|
@ -55,7 +55,11 @@ class CategoryUser < ActiveRecord::Base
|
||||
record.notification_level = level
|
||||
record.save!
|
||||
else
|
||||
CategoryUser.create!(user: user, category_id: category_id, notification_level: level)
|
||||
begin
|
||||
CategoryUser.create!(user: user, category_id: category_id, notification_level: level)
|
||||
rescue ActiveRecord::RecordNotUnique
|
||||
# does not matter
|
||||
end
|
||||
end
|
||||
|
||||
auto_watch(user_id: user.id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user