mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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) {
|
mutateValue(value) {
|
||||||
this.get("category").setNotification(value);
|
this.get("category").setNotification(value);
|
||||||
}
|
},
|
||||||
|
|
||||||
|
deselect() {}
|
||||||
});
|
});
|
||||||
|
@ -55,7 +55,11 @@ class CategoryUser < ActiveRecord::Base
|
|||||||
record.notification_level = level
|
record.notification_level = level
|
||||||
record.save!
|
record.save!
|
||||||
else
|
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
|
end
|
||||||
|
|
||||||
auto_watch(user_id: user.id)
|
auto_watch(user_id: user.id)
|
||||||
|
Loading…
Reference in New Issue
Block a user