# Take a break! Theme component

**URL:** <https://meta.discourse.org/t/take-a-break-theme-component/140248>\
**Category:** Theme component\
**Created:** [January 31, 2020, 12:36am UTC](https://meta.discourse.org/t/take-a-break-theme-component/140248 "2020-01-31T00:36:11Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)\
**Post date:** [January 31, 2020, 10:56am UTC](https://meta.discourse.org/t/take-a-break-theme-component/140248/4 "2020-01-31T10:56:12Z")

</div>

Hi @Chaboi_3000,

neat idea, we talked of something similar with @sam recently.

My main criticism is the code, it should be vastly improved, I can provide guidance if you are willing to improve it.

Few ways to improve it:

- indentation
- intervals should be cleared [https://mdn.beonex.com/en/DOM/window.clearInterval.html](https://mdn.beonex.com/en/DOM/window.clearInterval.html)
- you should look at how we can write themes with javascripts files now (eg: [GitHub - discourse/discourse-group-timezones · GitHub](https://github.com/discourse/discourse-group-timezones))
- we don’t use var anymore, let/const
- equality in js should be checked with === and not ==

Let me know if you need more help, happy to review more.

* * *

I’m a little bit concerned we can’t disable it on per user basis, as I would never use this. But we don’t have per user setting in theme components ATM. So I don’t see any good/easy solution here.

Maybe a good solution would be to have a pair of groups/message, that would make it slightly more configurable.

---

_[View the full topic](https://meta.discourse.org/t/take-a-break-theme-component/140248)._
