Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Telegram notification option into Notifications section #15

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants