discourse-telegram-notifications
discourse-telegram-notifications copied to clipboard
Move Telegram notification option into Notifications section
Should make the setting easier to find in a more obvious place.
Hmm, I should have tested it more, seems it doesn't actually save the value...
To make this save correctly, we need to add custom_fields
to the values here:
https://github.com/discourse/discourse/blob/46d1c91e1a0fd40110619b85bd2ed1623c70c6d0/app/assets/javascripts/discourse/app/controllers/preferences/notifications.js#L10-L19
This should be possible via the plugin API, using modifyClass
to override the init
function of the controller, calling super()
, then appending custom_fields
to this.saveAttrNames
.
The reason it worked before is that the Profile tab already has custom_fields
in the array:
https://github.com/discourse/discourse/blob/52672b9eabccb1184d85dc7f08062d5a7c18cb73/app/assets/javascripts/discourse/app/controllers/preferences/profile.js#L20
Ah, that explains the difference, so much magic! I'll see if I can plug this all together, thank you :)