The dismissed state will be stored between sessions if noticeId attribute is present.
It would be fairly easy to add a test for this.
I think the notice should re-appear at some point… otherwise people will just dismiss it after the first reply, and never mark a solution?
Maybe it could reappear after 7 days? Or after there have been new replies to the topic?
Also, beware: the keyvaluestore has no ‘expiry’ mechanism. I think we need some kind of expiry mechanism here so that we don’t end up with hundreds/thousands of ‘notice dismissed’ keys in the store. I did something similar in the discourse-placeholder-theme-component… but maybe we should add some expiry mechanism in the core
Putting this in
didInsertElement will mean that we get the sequence:
- Ember renders template with hidden=false
- Ember now has to re-render the template
Can we put this logic in the
init() hook? Or maybe
why noticeId and not noticeKey here ?
should probably set noticeId or noticeKey to null, not sure which one is used
Both of them work fine in this case.
noticeKey is a computed property. noticeId is a received attribute. I do not think any of them has to be defined here, right?
noticeId should be