Skip to content

Conversation

@jessicah
Copy link

Should make the setting easier to find in a more obvious place.

@jessicah
Copy link
Author

Hmm, I should have tested it more, seems it doesn't actually save the value...

@davidtaylorhq
Copy link
Owner

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

@jessicah
Copy link
Author

Ah, that explains the difference, so much magic! I'll see if I can plug this all together, thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants