Making filters work without reload

I’ve just done some work on discourse-solved, and added some filters. These work fine if you visit the URLs directly, but if you follow a link from within the site then it doesn’t work.

If I click on this link, it doesn’t apply the filter until I hit reload.

support - Discourse Meta

Do I need to add it to the Ember router or something like that? How would I go about doing that?

AddDiscoveryQueryParam is your friend

https://github.com/discourse/discourse-assign/blob/master/assets/javascripts/discourse/initializers/extend-for-assigns.js.es6#L59

Well, that was easy - it’s almost like someone’s had this problem before :wink:

Thanks again, I’ve submitted another PR

Just in case someone comes across this thread in future, using “true”/“false” in the query variables can create some unexpected behaviour. Ember will consider “false” the default, which might not be what you want.

Funktioniert das?

Ich habe bemerkt, dass die Filterung der Themen nicht funktioniert, wenn ich den Filter „solved“ auswähle, es sei denn, ich lade die Seite neu.