-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
[FIX] Loading theme CSS on first server startup #13953
Conversation
res.setHeader('Content-Type', 'text/css; charset=UTF-8'); | ||
res.setHeader('Content-Length', currentSize); | ||
res.setHeader('ETag', `"${ currentHash }"`); | ||
res.write(theme.getCss()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this actually exist?
I know let is defined outside this scope... but will this actually persist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes =)
Variables declared by let have their scope in the block for which they are defined, as well as in any contained sub-blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, if you're worried about theme
variable, it is a const that was being used before as well
@sampaiodiego could this be the reason that breaks the loading of theme.css when using Rocketchat in a subdirectory? I'm testing on develop branch and found out that now it asks for /theme.css which doesn't exist. |
I can take a look.. |
Thanks for the quick response! More info: It also happens in |
@facundomedica can you please help testing #14015 ? |
@sampaiodiego thank you, is there a way to have this uploaded to docker hub? I've been testing from there and I don't have the set up to run it in other way |
@facundomedica you can test with docker image |
Change the technique used to serve the
theme.css
file.Previous code was overwriting an internal meteor function that read/validate all assets of the app and if perhaps the CSS theme was already "ready" (the less was compiled), it was then added to assets list. This was causing an issue though, that on the first start of a server, where the compiled CSS was not yet saved on DB, then the
theme.css
was being served. Causing the UI to look like this:Previously, to fix the above issue a restart was required.